Jump to content

Has anyone come across this problem before?


spires

Recommended Posts

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.

:-)

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>

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.