Enjoy an ad free experience by logging in. Not a member yet?
Register .
06-09-2004, 08:10 PM
PM User |
#1
New Coder
Join Date: Feb 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Scrolling problems :(
Hi
Guys I'm using a Iframe plugin from this page to create my own customize scroll window
http://www.fourlevel.com/product/iframe/demo/index.htm but I got stuck on the tutorial and is not working for me.
This is a sample of the files I'm working on, as you can see when you rollover the arrows the text kind of move on a weird way but doesn't scroll
http://69.194.44.7/ScrollTest/ScrollTest.htm
Any ideas?
Thanks
Alex
06-10-2004, 01:32 AM
PM User |
#2
New Coder
Join Date: May 2004
Location: Some place called the Earth I think...
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
I don't know how to fix that script, but take a look at my page and see if it helps (view source of course)
here (the url is funky cause i was using it to show an alpha class in css, oh and go to the links page to see it in action, i dont know why but the home doesnt work with the scroller)
look at your site with a scroller:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<link href="DeaconCSS/Deacon.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
<!--
var scroll;
function scrollerUp(theSpeed) {
parent.frame1.scrollBy(0, -3);
scroll=setTimeout('scrollerUp()',theSpeed);
}
function scrollerDown(theSpeed) {
parent.frame1.scrollBy(0, 3);
scroll=setTimeout('scrollerDown()',theSpeed);
}
function stop() {
clearTimeout(scroll);
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script language="javascript" type="text/javascript">
<!--
var iF_timer=null;
function stopScroll(){
clearTimeout(iF_timer)}
//-->
</script>
<style type="text/css">
<!--
body {
background-color: #000000;
}
-->
</style>
</head>
<body onLoad="MM_preloadImages('Images/Buttons/UpArrow_RO.gif','Images/Buttons/DownArrow_RO.gif')">
<table width="598" height="408" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="BorderOrange_Sides">
<tr>
<td><table width="598" height="408" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="170" height="408" bgcolor="#006600"><img src="Images/Comun/Transparent.gif" width="170" height="408"></td>
<td align="right"><table width="428" height="408" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="413" height="408"><iframe src="http://www.msn.com " width="413px" height="408px" scrolling="No" frameborder="0" name="frame1" id="frame1"></iframe></td>
<td table width="10" height="408"><table width="15" height="408" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="10" height="408" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10" height="10"><img src="Images/Comun/Transparent.gif" width="10" height="10"></td>
</tr>
<tr>
<td width="10" height="13"><a href="javascript :;" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Up Scroll1','','Images/Buttons/UpArrow_RO.gif',1)"><img src="Images/Buttons/UpArrow.gif" alt="Up Scroll" name="Up Scroll1" width="10" height="13" border="0" id="Up Scroll1" onMouseOver="scrollerUp('Up Scrolll',6)" onMouseOut="stop();"></a></td>
</tr>
<tr>
<td width="10" height="362"><img src="Images/Comun/Transparent.gif" width="1" height="362"></td>
</tr>
<tr>
<td width="10" height="13"><a href="javascript :;" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Down Scroll1','','Images/Buttons/DownArrow_RO.gif',1)"><img src="Images/Buttons/DownArrow.gif" alt="Down Scroll" name="Down Scroll1" width="10" height="13" border="0" id="Down Scroll1" onMouseOver="scrollerDown('Down Scrolll',6)" onMouseOut="stop();"></a></td>
</tr>
<tr>
<td width="10" height="10"><img src="Images/Comun/Transparent.gif" width="10" height="10"></td>
</tr>
</table></td>
<td width="5" height="408"><img src="Images/Comun/Transparent.gif" width="5" height="1"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
(i cant do text.htm on frontpage because it isnt my file, so instead I put msn.com)
__________________
Dont do drugs, get high on life
13 years and getting nowhere fast.....
Ð ðô M _ M öñkè ¥
Last edited by DooM_MonkeY; 06-10-2004 at 01:46 AM ..
06-10-2004, 02:45 AM
PM User |
#3
New Coder
Join Date: Feb 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
YEAH !!!!!!!!!!!!!!!!!!
THANKS DooM_MonkeY
Tell me what you did bro?
How did you made it work?
06-10-2004, 05:13 AM
PM User |
#5
Supreme Master coder!
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
You are now referencing the iframe incorrectly.
parent.frame1.scrollBy(0, -3);
Should be:
window.frame1.scrollBy(0, -3);
or
window.frames['frame1'].scrollBy(0, -3);
You can also use self in place of window .
The reason it worked on a frame-less page is that parent == window , whereas in a framed page, parent == frameset window.
06-10-2004, 05:20 AM
PM User |
#6
New Coder
Join Date: May 2004
Location: Some place called the Earth I think...
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
no problemo, hey thanks glen for the tip, im kinda new to javascript myself, so that will come in handy
__________________
Dont do drugs, get high on life
13 years and getting nowhere fast.....
Ð ðô M _ M öñkè ¥
06-10-2004, 02:38 PM
PM User |
#7
New Coder
Join Date: Feb 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
YEah again
thanks glenngv, ou were right I just had to change the way I was calling Iframe, window.frame works
http://69.194.44.7/ScrollTest/FramesTest.htm
06-10-2004, 10:52 PM
PM User |
#8
New Coder
Join Date: May 2004
Location: Some place called the Earth I think...
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Oh and if you want to change the speed go
Code:
var scroll;
function scrollUp(theSpeed )
window.frame1.scrollBy(0, -5 (change to any number) )
scroll=setTimeout('scrollerUp()',theSpeed );
}
then for scrolling down do the same thing exept with no - on the scrollby code
__________________
Dont do drugs, get high on life
13 years and getting nowhere fast.....
Ð ðô M _ M öñkè ¥
Jump To Top of Thread
Thread Tools
Rate This Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 04:54 AM .
Advertisement
Log in to turn off these ads.