homepage Welcome to WebmasterWorld Guest from 54.166.96.101
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Iframe Scrolling
iframe scrolling outpage
atrjeu_ne



 
Msg#: 4176025 posted 5:08 am on Jul 25, 2010 (gmt 0)

I've trying looking for a script that allow me scroll an iframe fromanother page, i finally found it, and works well in FF and IE:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>

<meta HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
* {
margin:0;
padding:0;
}
body {
margin:40px;
}
select {
width:130px;
}
#container {
width:1000px;
height:600px;
border:3px double #999;
margin:auto;
}
#myiframe {
width:100%;
height:100%;
}
</style>

<script type="text/javascript">
window.onload=function() {
document.forms[0][0].onchange=function() {
divscroll(this.value);
}
}
function divscroll(num) {
if(num!='') {
document.getElementById('myiframe').contentWindow.scrollTo(0,num);
}
}
</script>

</head>
<body>

<form action="#">
<div>
<select>
<option value=""> scroll to options </option>
<option value="0">0</option>
<option value="215" default>215</option>
<option value="365">365</option>
<option value="515">515</option>
<option value="750">750</option>
</select>
</div>
</form>

<div id="container">
<iframe src="lorem.php" id="myiframe" frameborder="0" scrolling="no" ></iframe>
<!--<IFRAME src= 'lorem.html' id="myiframe scrolling="no" WIDTH="1010" HEIGHT="500">-->
</div>
</body>
</html>

You must to create another page "lorem.html" and insert this:

<IFRAME src= 'http://www.thepageThatYouWantToInsert.com' WIDTH="1010" HEIGHT="700"><BR></IFRAME>

¡Saludos desde México!

 

tedster

WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4176025 posted 2:15 am on Aug 5, 2010 (gmt 0)

Thanks for sharing this - it can come in handy at times.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved