Make DIV invisible in CSS and JavaScript

后端 未结 6 1417
执笔经年
执笔经年 2021-02-07 00:49

I have managed to make a DIV tag invisible in JavaScript by setting the display to none and the visibility to hidden. It can be achieved with this class also:

.i         


        
6条回答
  •  你的背包
    2021-02-07 01:07

    You can use jQuery to acheive the solution. If you want to totally hide/show the div, then u can use:

    $('#my_element').show()
    $('#my_element').hide()
    

    And if you want that your div become invisible and its still existing in the page, then you can use efficient trick:

    $('#my_element').css('opacity', '0.0');  // invisible Maximum
    $('#my_element').css('opacity', '1.0');  // visible maximum
    

提交回复
热议问题