Home > Web Front-end > JS Tutorial > body text

jQuery: show() method

巴扎黑
Release: 2017-06-29 10:44:07
Original
2309 people have browsed it

The

show() method is a jQuery method. Its function is to display elements. The parameter is time and the unit is milliseconds. For example:

Html:

        id为one,class为one的p        <p class="mini">class为mini</p>
    </p>
    <p class="one" id="two" title="test">
        id为two,class为one,title为test的p        <p class="mini" title="other">class为mini,title为other</p>
        <p class="mini" title="test">class为mini,title为test</p>
    </p>
    <p class="one">
        <p class="mini">class为mini</p>
        <p class="mini">class为mini</p>
        <p class="mini">class为mini</p>
        <p class="mini"></p>
    </p>
    <p class="one">
        <p class="mini">class为mini</p>
        <p class="mini">class为mini</p>
        <p class="mini">class为mini</p>
        <p class="mini" title="test">class为mini,title为test</p>
    </p>
    <p style="display:none" class="none">
        style的display为"none"的p    </p>
    <p class="hide">class为"hide"的p</p>
    <p>
        包含input的type为"hidden"的p<input type="hidden" size="8"/>
    </p>
    <span id="mover">正在执行动画的span元素</span>
Copy after login

View Code

CSS:


p,span,p{
    width:140px;
    height:140px;
    margin:5px;
    background:#aaa;
    border:#000 1px solid;
    float:left;
    font-size:17px;
    font-family:Verdana, Geneva, Tahoma, sans-serif, 宋体;
}p.mini{
    width:55px;
    height:55px;
    background-color:#aaa;
    font-size:12px;
}p.hide{
    display:none;
}
Copy after login

View Code

js:


<script type="text/javascript" src="jquery-1.11.0.js/jquery-1.11.0.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
            $("p:hidden").css("background","#bbffaa");
            $("p:hidden").show(3000);
    });</script>
Copy after login

Screenshot:

##

The above is the detailed content of jQuery: show() method. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!