Hi,

I got a little problem with prototype/scriptacolous effects. I have an
unordered list (Navigation element) that I want to apply an effect on.
If you hover over one of the images, all other images should fade out.
The effect itself works fine, but the problem is, that after I hover
on another img while the effect of the first image is still active,
some of the images flicker. I tried to solve this by using scopes and
limits, but it doesnt seem to work right.

Does anyone have an answer to this problem?

<div id="products_new">
  <ul>
    <li><a href="#"><img src="test.jpg" /></a></li>
    <li><a href="#"><img src="test.jpg" /></a></li>
    <li><a href="#"><img src="test.jpg" /></a></li>
    <li><a href="#"><img src="test.jpg" /></a></li>
    <li><a href="#"><img src="test.jpg" /></a></li>
  </ul>
</div>


JS:
function createSpecialEffects() {

        // Cache needed elements
        elms = $$('div#products_new ul li a img');

        elms.each(function(slink) {

                slink.observe('mouseover', function(e) {

                        this.elm = Event.element(e);
                        this.elm_array = new Array();
                        this.elm_array = elms.without(this.elm);

                        this.elm_array.each(function(elms) {
                                elms.fade({
                                        duration: 0.5,
                                        to: 0.3,
                                        scope: 'specials',
                                        limit: '1'
                                });
                        });
                });

                slink.observe('mouseout', function(e) {

                        this.elm_array.each(function(elms) {
                                elms.appear({
                                        duration: 0.5,
                                        to: 1.0,
                                        scope: 'specials',
                                        limit: '1'
                                });
                        });

                });


        });

}

--~--~---------~--~----~------------~-------~--~----~
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