Solved

Dreamweaver & Inline Frame

Posted on 2006-11-11
13
862 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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 discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now