JQuery toggle is hiding the div element

前端 未结 2 701
我在风中等你
我在风中等你 2021-01-22 08:55

I\'m having some trouble with developing an expand-shrink toggle div.

My goal is to click the div and make it bigger, clicking it again and get it back to the original h

2条回答
  •  一个人的身影
    2021-01-22 09:34

    toggle() (Event) event is deprecated in jQuery 1.8 and removed in jQuery 1.9.

    Current .toggle() function changes the state of the element.


    $(document).ready(function () {
        $(".noticia").click(function(){
            $(this).css('height', $(this).css('height') == "420px" ? "600px" : "420px");
        });
    });
    

提交回复
热议问题