 |
 |
how do I modify scrollable iFrame code
|
 |
|
 |
|
Mac Elite
Join Date: Jan 2000
Location: Pittsburgh, PA
Status:
Offline
|
|
I utilize this very neat script a few times on my page, from here http://www.dynamicdrive.com/dynamici...ramescroll.htm
Basically, this time I want to modify the script so that the links will scroll the frame left to right, not up and donw. I am certain that the key is in the code below (the code that is placed on the page that loads IN the ifram), but I can't figure it out. Any suggestions from the Javascript whizes out there?
<!--DO NOT REMOVE BELOW SCRIPT. IT SHOULD ALWAYS APPEAR AT THE VERY END OF YOUR CONTENT-->[SCRIPT] language=JavaScript1.2></SCRIPT></P>
<P align=left>[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]
|

spike[at]avenirex[dot]com | Avenirex
IM - Avenirx | ICQ - 3932806
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status:
Offline
|
|
I'm having a stab in the dark here:
Change
temp=(document.all)? document.body.scrollTop : window.pageYOffset
to read
temp=(document.all)? document.body.scrollLeft : window.pageXOffset
and
window.scrollBy(0,speed)
to read
window.scrollBy(speed,0)
|
|
Computer thez nohhh...
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jan 2000
Location: Pittsburgh, PA
Status:
Offline
|
|
Originally posted by Simon Mundy:
I'm having a stab in the dark here:
Change
temp=(document.all)? document.body.scrollTop : window.pageYOffset
to read
temp=(document.all)? document.body.scrollLeft : window.pageXOffset
and
window.scrollBy(0,speed)
to read
window.scrollBy(speed,0)
I had tried that first part, but not the second (speed,0). Will have to look into it. As for right now, the site design changed, and it's back to a vertical scroll, but I'll test it out in the future. Thanks for the response.
|

spike[at]avenirex[dot]com | Avenirex
IM - Avenirx | ICQ - 3932806
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum 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
|
|
|
|
|
|
 |
 |
 |
 |
|
 |