Solved

Dreamweaver & Inline Frame

Posted on 2006-11-11
13
864 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
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

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…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

772 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