Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > how do I modify scrollable iFrame code

how do I modify scrollable iFrame code
Thread Tools
Mac Elite
Join Date: Jan 2000
Location: Pittsburgh, PA
Status: Offline
Reply With Quote
Oct 20, 2003, 03:51 PM
 
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
Reply With Quote
Oct 20, 2003, 06:06 PM
 
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...
     
Avenir  (op)
Mac Elite
Join Date: Jan 2000
Location: Pittsburgh, PA
Status: Offline
Reply With Quote
Oct 21, 2003, 04:38 PM
 
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
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:17 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2