Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing var for menu position.

Status
Not open for further replies.

ro6er

Programmer
Jul 1, 2003
76
Hi, It might be a simple one but I just can't figure it out. On the following page:
when you use the thumbnails menu, and you click on one that's at the bottom that you have to scroll to using the more button, the whole menu jumps back to the top. My client wants to see that it 'freezes' at the point where you last clicked a thumbnail.

I know this moves it up and down:

onclick="dw_scrollObj.scrollBy('wn',0,-92); return false"

I tried to implement that into a link on the thumbnail so that it passes a var to the next page to hold the position. But just can't seem to get it. All I really need is to know how to generate the link. I can figure out the dynamic part of getting the asp to get it to the right number ie.

onclick="dw_scrollObj.scrollBy('wn',0,-184); return false" or whatever.

Or maybe there's just an easier way of doing this..

Thanks for any help.

Roger
 
Hi

For example this works in Gecko, Presto and KHTML, not works in WebKit, not tested in Trident :
JavaScript:
[b]function[/b] [COLOR=darkgoldenrod]saveposition[/color][teal]()[/teal]
[teal]{[/teal]
  [COLOR=darkgoldenrod]setcookie[/color][teal]([/teal][green][i]'y'[/i][/green][teal],[/teal]window[teal].[/teal]scrollY[teal])[/teal]
[teal]}[/teal]

[b]function[/b] [COLOR=darkgoldenrod]loadposition[/color][teal]()[/teal]
[teal]{[/teal]
  window[teal].[/teal][COLOR=darkgoldenrod]scrollTo[/color][teal]([/teal][purple]0[/purple][teal],[/teal][COLOR=darkgoldenrod]parseInt[/color][teal]([/teal][COLOR=darkgoldenrod]getcookie[/color][teal]([/teal][green][i]'y'[/i][/green][teal]),[/teal][purple]10[/purple][teal]))[/teal]
[teal]}[/teal]
Search the web for [tt]setcookie()[/tt] / [tt]getcookie()[/tt] functions.

Feherke.
 
Thanks, I get what your saying. And sorry if I sound a bit dim but I can't get that to work.

Would I be needing to change
window.scrollTo(0,parseInt(getcookie('y'),10))

to include this somehow?
onclick="dw_scrollObj.scrollBy('wn',0,-92); return false"

In the meantime I'll see if I can get that working but nothing so far.

Roger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top