On May 25, 1:46 pm, bambam007 <spleensm...@optusnet.com.au> wrote:
> I am using the slider and mouse scroll to scroll inside a div
> Now i want to add anchor button. so when i click the button, the
> specified div scrolls to the ID. and the slider updates accordingly.
> You can see my code 
> athttp://www.codingforums.com/showthread.php?p=820484#post820484
>
> with this I can scroll, but it scrolls the whole page as well as the
> div. And the slider does not update.
>
> I have been working on it with the below code but nothing happens
> <a href="#" onclick="$(table_scripts).Effect.ScrollTo('7',{ duration:
> 16 }); return false;">Click me to</a>
>
> table_scripts is the name of the containing div with the scroll.
>
> Please help

That's not the right syntax for Effects. Effect is a constructor, not
a method of Element. You need

new Effect.ScrollTo('table_scripts', ...

Also, I strongly recommend you don't use the DOM0 method ('onclick')
but instead use

<a href="#" id = 'scrollme'>
...
(somewhere inside a <script> tag)
$('scrollme').observe('click', function() {new Effect.ScrollTo
('table_scripts', ...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to