Initially hiding a div for later display

前端 未结 6 1021
清歌不尽
清歌不尽 2020-12-29 05:24

My web page is like the following:

TEXT, FORMS, and STUFF
6条回答
  •  自闭症患者
    2020-12-29 06:17

    Why not use jQuery show and hide?

    Hide the elements you want to hide (duh) on page load with CSS:

    #id1, #id2, .. {
        display: none;
    } 
    

    Or you can hide it with Javacript:

    $('#id1, #id2, ..').hide();
    

    Show or hide them by using:

    $('#btn2').click(function() {
        $('#id1, #id3').hide();
        $('#id2').show();
    });
    

提交回复
热议问题