onマウスアクションの指定
---
$(function(){ $('li').hover( function(){ $(this).css({ backgroundColor: '#ffbbbb', cursor: "pointer" }); var str = $(this).text(); $('#hovertext').text(str); }, function(){ $(this).css('backgroundColor','#777'); str = '---'; $('#hovertext').text(str); } ); });
element1
element2
element3
$(function(){ $("p").hover(function(){ $(this).fadeOut(500).fadeIn(500); }); });
$(function(){ s3count = 0; $("#s3Div").hover(s3Func); }); function s3Func(){ s3count++; $("#s3Div").text(s3count); }
$(function(){ $("#s4Div").hover(function(){ $(this).animate({ "width": "400px" }, 1000); }, function(){ $(this).animate({ "width": "100px" }, 1000); }); });