stncttr908
11-25-2003, 05:27 PM
Alright, here is my problem. I have an inline frame on my main page, and rather than using ugly scrollbars I chose to use this script (http://www.dynamicdrive.com/dynamicindex17/iframescroll.htm) to scroll the content. The problem is, my university doesn't support php scripting so I have to host my guestbook elsewhere. However, whenever I load the guestbook into the frame and try to scroll it, I get a javascript error. All pages on the same domain as the main page work correctly. I have included all of the necessary code. Can someone please explain to me why this occurs?
Here is the code for the iframe.
<table border=0 cellpadding=0 cellspacing=0 width=438>
<TR>
<!--Scrollable iframe script- By Dynamic Drive-->
<!--For full source code and more DHTML scripts, visit http://www.dynamicdrive.com-->
<!--This credit MUST stay intact for use-->
<TD><img src="images\left.jpg" border=0></TD>
<TD><iframe src="news.php" id="datamain" width="363" height="287" frameborder="0" marginwidth="0" scrolling="no" name="iframe">
</iframe></TD>
<TD><img src="images\right.jpg" border=0></TD>
</TR></table>
</table><table border=0 cellpadding=0 cellspacing=0 width=438>
<TR>
<TD><img src="images\bottom.jpg" border=0></TD>
</TR>
</TABLE>
And the code included on all of the pages after the end html tag.
<!--DO NOT REMOVE BELOW SCRIPT. IT SHOULD ALWAYS APPEAR AT THE VERY END OF YOUR CONTENT-->
<script language="JavaScript1.2">
//Scrollable content III- By http://www.dynamicdrive.com
var speed, currentpos=curpos1=0,alt=1,curpos2=-1
function initialize(){
if (window.parent.scrollspeed!=0){
speed=window.parent.scrollspeed
scrollwindow()
}
}
function scrollwindow(){
temp=(document.all)? document.body.scrollTop : window.pageYOffset
alt=(alt==0)? 1 : 0
if (alt==0)
curpos1=temp
else
curpos2=temp
window.scrollBy(0,speed)
}
setInterval("initialize()",10)
</script>Works beautifully on all pages besides the page on another domain. Makes no sense to me. Any help would be greatly appreciated.
Here is the code for the iframe.
<table border=0 cellpadding=0 cellspacing=0 width=438>
<TR>
<!--Scrollable iframe script- By Dynamic Drive-->
<!--For full source code and more DHTML scripts, visit http://www.dynamicdrive.com-->
<!--This credit MUST stay intact for use-->
<TD><img src="images\left.jpg" border=0></TD>
<TD><iframe src="news.php" id="datamain" width="363" height="287" frameborder="0" marginwidth="0" scrolling="no" name="iframe">
</iframe></TD>
<TD><img src="images\right.jpg" border=0></TD>
</TR></table>
</table><table border=0 cellpadding=0 cellspacing=0 width=438>
<TR>
<TD><img src="images\bottom.jpg" border=0></TD>
</TR>
</TABLE>
And the code included on all of the pages after the end html tag.
<!--DO NOT REMOVE BELOW SCRIPT. IT SHOULD ALWAYS APPEAR AT THE VERY END OF YOUR CONTENT-->
<script language="JavaScript1.2">
//Scrollable content III- By http://www.dynamicdrive.com
var speed, currentpos=curpos1=0,alt=1,curpos2=-1
function initialize(){
if (window.parent.scrollspeed!=0){
speed=window.parent.scrollspeed
scrollwindow()
}
}
function scrollwindow(){
temp=(document.all)? document.body.scrollTop : window.pageYOffset
alt=(alt==0)? 1 : 0
if (alt==0)
curpos1=temp
else
curpos2=temp
window.scrollBy(0,speed)
}
setInterval("initialize()",10)
</script>Works beautifully on all pages besides the page on another domain. Makes no sense to me. Any help would be greatly appreciated.