spires Posted November 7, 2007 Share Posted November 7, 2007 Hi Guys. Please check out this site. Check out http://www.spirestest.com/product2.php HOW IT WORKS: Whats happens is the 'more information >>' button will start the mootools scroll effect. There are 7 areas that get scrolled through. The 'more information >>' button only appears in the first area. After that the button chages to '' = Next area. THE PROBLEM: Each of the buttons use an 'id' this determines which area will show. For Example id="link3" will go to 'area 3'. But whats happening is, I can only use the id="***" once on the page. If I use it for a second time, only the link that appears first is active. The second link, does nothing. STRUCTURE: * = Does not work. >> = id="link2" << = id="link1" | >> = id="link3" << = id="link2"* | >> = id="link4" << = id="link3"* | >> = id="link5" << = id="link4"* | >> = id="link6" << = id="link5"* | >> = id="link7" << = id="link6"* | >> = id="link1"* As you can see, If the link has all ready been used higher up the list, the second time it's used, it will not work. Why is this? Please can some one shed some light on this. I am completely stuck, and would love to hear your thoughts on this. Thanks for all your help. :-) Quote Link to comment Share on other sites More sharing options...
fenway Posted November 7, 2007 Share Posted November 7, 2007 You can't reuse IDs. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted November 7, 2007 Share Posted November 7, 2007 Is an onclick mootools event being used in those 'buttons'? If so, then you should not even need an id value for the 'button', just pass the id value: <a href="???" onclick="mootoolsfunction('link3', parm2, parm3);return false;">link</a> Quote Link to comment Share on other sites More sharing options...
emehrkay Posted November 8, 2007 Share Posted November 8, 2007 mootools has great selectors. what you could do is give the links that control the scrolling action the same class name and give them unique ids <a link="#" class="scroller_link" id="link:1">link</a> then use the $$ selector to select all of those links $$('.scroller_link').each(function(link){ var scroll = this.id.split(':'); link.addEvent('click',function(e){ e = new Event(e).stop(); scroll.toElement('content' + scroll[1]); }); }); hopefully that will work for you. use those few lines to replace each addevent for every link ele that you have Quote Link to comment Share on other sites More sharing options...
emehrkay Posted November 8, 2007 Share Posted November 8, 2007 I've actually done the exact same thing wiht my pager script. Check it out here http://8trk.com/splash.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.