hide div when mouseout

后端 未结 5 1131
忘掉有多难
忘掉有多难 2021-01-19 08:39

I have two div\'s, one for short summary and one for long summary.
When I \"mouseover\" on the short summary, the short summary disappears and the long summary appears.<

5条回答
  •  悲&欢浪女
    2021-01-19 09:22

    Try this Working demo: http://jsfiddle.net/UG3FZ/

    This demo is using following APIs :

    .mouseout- http://api.jquery.com/mouseover/

    .mouseover - http://api.jquery.com/mouseout/

    Since you are using JQ latest, if I may suggest read through the api jquery and few tips online.

    Rest the demo should serve your needs :)

    Code

    $(function() {
        $(".show_div").mouseover(function() {
            $(this).next().show();
            $(this).hide("slow");
        });
    
        $(".hide_div").mouseout(function() {
            $(this).prev().show();
            $(this).hide("slow");
    
        });
    });​
    

提交回复
热议问题