Solved

Dreamweaver & Inline Frame

Posted on 2006-11-11
13
866 Views
Last Modified: 2012-08-14
I am new to Dreamwever and I was trying to add an Inline frame to my page to view an external site within my page, is this possible?
0
Comment
Question by:davidrichardson
  • 5
  • 5
  • 2
13 Comments
 
LVL 10

Accepted Solution

by:
aplimedia earned 125 total points
ID: 17922765
Yes its very easy... Copy and paste this into the body of your page..

<iframe width="300" height="500"
src ="http://www.jonbysoft.com">
</iframe>

Aplimedia
0
 
LVL 3

Expert Comment

by:judsonmusic
ID: 17923574
you can use iframe but also want to use a scroll parent command just incase you are using an iframe to go between pages that are bigger than the paged in the iframe!

use this in all of the pages that the iframe will point to.

<body onload="window.parent.scroll (0,0)">

this will make your parent page always scroll to the top so that your links and header are always there.
0
 
LVL 7

Author Comment

by:davidrichardson
ID: 17924458
I cant believe I was looking for a complied answer thanks for that Aplimedia, judsonmusic could you explain abit more I cant seem to get it to work.
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Expert Comment

by:judsonmusic
ID: 17924603
Are you talking about the scroll part?


0
 
LVL 7

Author Comment

by:davidrichardson
ID: 17925031
yes
0
 
LVL 3

Assisted Solution

by:judsonmusic
judsonmusic earned 125 total points
ID: 17925849
you have to pu that in the<body> tag of your page that is nested within the iframe. Make sure you put it right below the </head>

What is does is this.

Lets say I am on the parent page that the iframe sits in. Lets say that the iframe doesnt scroll. I use the parent page to scroll.

If I scroll down on the parent page to view somthing at the bottom of the iframe page, and click a link,

I want it to reset back to the top of the parent page to make it look like a new page and also show my header. If you dont use this command, it will go to the next page and stay in the position where you left off.

that is why it is crucial to use this.

Judson

ps, if you laready have things in the bodytag like topmargin ="0", etc. just add the tag like this example:

 <body link = #000000 lvink = #000000 alink = #000000 topmargin ="0" onload="window.parent.scroll (0,0)">  

this tells the page the link colors the margin and to scroll the parent page to the top.

BTW,

here is the code for the ifram that will do everything that you want:

<script type="text/javascript">

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:(you should only need one unless you are using more than one iframe on a page)

//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:

var iframeids=["wf_cnt"]

 

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):

var iframehide="yes"

 

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]

var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

 

function resizeCaller() {

var dyniframe=new Array()

for (i=0; i<iframeids.length; i++){

if (document.getElementById)

resizeIframe(iframeids[i])

//reveal iframe for lower end browsers? (see var above):

if ((document.all || document.getElementById) && iframehide=="no"){

var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])

tempobj.style.display="block"

}

}

}

 

function resizeIframe(frameid){

var currentfr=document.getElementById(frameid)

if (currentfr && !window.opera){

currentfr.style.display="block"

if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax

currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;

else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax

currentfr.height = currentfr.Document.body.scrollHeight;

if (currentfr.addEventListener)

currentfr.addEventListener("load", readjustIframe, false)

else if (currentfr.attachEvent){

currentfr.detachEvent("onload", readjustIframe) // Bug fix line

currentfr.attachEvent("onload", readjustIframe)

}

}

}

 

function readjustIframe(loadevt) {

var crossevt=(window.event)? event : loadevt

var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement

if (iframeroot)

resizeIframe(iframeroot.id);

}

 

function loadintoIframe(iframeid, url){

if (document.getElementById)

document.getElementById(iframeid).src=url

}

 

if (window.addEventListener)

window.addEventListener("load", resizeCaller, false)

else if (window.attachEvent)

window.attachEvent("onload", resizeCaller)

else

window.onload=resizeCaller

 

</script>

</head>

<body onLoad="scroll(0,0)">



0
 
LVL 7

Author Comment

by:davidrichardson
ID: 17926131
Thanks for the example, but i cant get it to resize?

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<script type="text/javascript">

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:(you should only need one unless you are using more than one iframe on a page)

//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:

var iframeids=["wf_cnt"]

 

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):

var iframehide="yes"

 

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]

var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

 

function resizeCaller() {

var dyniframe=new Array()

for (i=0; i<iframeids.length; i++){

if (document.getElementById)

resizeIframe(iframeids[i])

//reveal iframe for lower end browsers? (see var above):

if ((document.all || document.getElementById) && iframehide=="no"){

var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])

tempobj.style.display="block"

}

}

}

 

function resizeIframe(frameid){

var currentfr=document.getElementById(frameid)

if (currentfr && !window.opera){

currentfr.style.display="block"

if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax

currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;

else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax

currentfr.height = currentfr.Document.body.scrollHeight;

if (currentfr.addEventListener)

currentfr.addEventListener("load", readjustIframe, false)

else if (currentfr.attachEvent){

currentfr.detachEvent("onload", readjustIframe) // Bug fix line

currentfr.attachEvent("onload", readjustIframe)

}

}

}

 

function readjustIframe(loadevt) {

var crossevt=(window.event)? event : loadevt

var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement

if (iframeroot)

resizeIframe(iframeroot.id);

}

 

function loadintoIframe(iframeid, url){

if (document.getElementById)

document.getElementById(iframeid).src=url

}

 

if (window.addEventListener)

window.addEventListener("load", resizeCaller, false)

else if (window.attachEvent)

window.attachEvent("onload", resizeCaller)

else

window.onload=resizeCaller

 

</script>

<iframe name="wf_cnt" width="1005" height="366" src="http://www.experts-exchange.com/Web/WebDevSoftware/DreamWeaver/Q_22057219.html#17925849">
Your browser does not support inline frames or is currently configured not to display inline frames.

</iframe>

</body>

</html>
0
 
LVL 7

Author Comment

by:davidrichardson
ID: 17928786
judsonmusic i have had a better look at it this morning it wont resise on external sites is there a way around it? (The site is a promotional page from one of our suppliers)
0
 
LVL 3

Expert Comment

by:judsonmusic
ID: 17929422
i dont think, but let me research it and Ill get back to you.

you may look at using a scroll on the iframe for that .
0
 
LVL 10

Expert Comment

by:aplimedia
ID: 18104725
I object.... the question was answered.

Aplimedia
0
 
LVL 3

Expert Comment

by:judsonmusic
ID: 18104809
The question was answered well
0
 
LVL 7

Author Comment

by:davidrichardson
ID: 18105755
Sorry i should of closed earlyer, i have increased the points and split, aplimedia answered the original question and judsonmusic gave me aditional guidance

Thanks again
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question