Skip to content Skip to sidebar Skip to footer

Making Js Activate Divs Sepratly

i am new to JS and need some help please! I have 2 Boxes(divs) that have a slider in each one. When I mouse over anyone of them, both sliders are activated. How would i make it so

Solution 1:

$(document).ready(function(){
    $('.up-down').mouseover(function(){
        $(this).find('.default').stop().animate({
            height: 0  
        }, 200);                        
    }).mouseout(function(){
        $(this).find('.default').stop().animate({
            height: 170 
        }, 200)    
    })
});

Using $(this).find will find the specific .default which is contained within the current element, rather than every .default.


Post a Comment for "Making Js Activate Divs Sepratly"