Jquery bind, multiple events div

<div class=”test”><div class=”inside”><h1>id=”myID.entry[0]”</h1><p>0</p></div></div>

<script>$(“div.test”).bind({
click: function(){
$(this).addClass(“active”);
//alert(this.nodeName);
//alert($(this).text())

},
mouseenter: function(){
$(this).children(‘div.inside’).animate({
top: “20px”,
}, “fast”);
},
mouseleave: function(){
//$(this).fadeIn();
$(this).children(‘div.inside’).animate({
top: “100px”,
}, “fast”);
}
});</script>

One thought on “Jquery bind, multiple events div

  1. var inside = $(‘.inside’);

    inside.hover(
    function() {
    if(!inside.data(‘bottom’)) {
    inside.data(‘bottom’,$(this).children(“.coll_base”).css(‘bottom’));
    }
    $(this).children(“.coll_base”).stop().animate({ bottom:’+=30px’ },”slow”)
    },
    function() {
    $(this).children(“.coll_base”).stop().animate({bottom:$(this).data(‘bottom’) },”slow”);
    }
    );​

Leave a Reply