网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 jQuery内容折叠效果插件用法实例分析(附demo源码)
内容
    这篇文章主要介绍了jQuery内容折叠效果插件用法,结合实例形式分析了jQuery展开折叠插件jquery.coolfieldset.js的具体使用技巧,并附带demo源码供读者下载参考,需要的朋友可以参考下
    本文实例讲述了jQuery内容折叠效果插件用法。分享给大家供大家参考,具体如下:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
      <title>jQuery Collapsible Fieldset</title>
      <script src="js/jquery.min.js"></script>
      <script language="javascript" type="text/javascript" src="js/jquery.coolfieldset.js"></script>
      <link rel="stylesheet" type="text/css" href="css/jquery.coolfieldset.css" />
    </head>
    <body>
      <h1>jQuery Collapsible Fieldset</h1>
      <br/>
      <fieldset id="fieldset1">
        <legend>Default</legend>
        <div>
          <p>By default the <b>fieldset</b> is opened or expanded at start. Click on its <b>legend</b> to close or collapse it.</p>
          <p>The code is simply like below</p>
    <pre>
    $('#fieldset1').coolfieldset();
    </pre>
        </div>
      </fieldset>
      <br/>
      <fieldset id="fieldset2">
        <legend>Closed at start</legend>
        <div>
          <p>If we want the fieldset to be closed or collapsed at start, just add <b>{collapsed:true}</b> as the argument.</p>
    <pre>
    $('#fieldset2').coolfieldset({collapsed:true});
    </pre>
        </div>
      </fieldset>
      <br/>
      <fieldset id="fieldset4">
        <legend>Animation Speed</legend>
        <div>
          <p>You can also define the animation speed for the fieldset while collapsing or expanding by using <b>speed</b> option. Acceptable values are "<b>fast</b>", "<b>medium</b>", "<b>slow</b>", or a number in millisecond.</p>
    <pre>
    $('#fieldset3').coolfieldset({speed:"fast"});
    </pre>
        </div>
      </fieldset>
      <br/>
      <fieldset id="fieldset5">
        <legend>No Animation</legend>
        <div>
          <p>If you don't want to use animation effect, please use <b>animation</b> option and fill its value with <b>false</b>.</p>
    <pre>
    $('#fieldset4').coolfieldset({animation:false});
    </pre>
        </div>
      </fieldset>
      <br/><br/>
      <fieldset id="fieldset3">
        <legend>Notes :</legend>
        <div>
          <ul>
            <li>All content inside fieldset (except the <b>legend</b> tag) should be placed inside the <b>div</b> tag.</li>
            <li>Edit the <b>jquery.coolfieldset.css</b> to change the fieldset style.</li>
          </ul>
        </div>
      </fieldset>
      <script>
        $('#fieldset1, #fieldset3').coolfieldset();
        $('#fieldset2').coolfieldset({collapsed:true});
        $('#fieldset4').coolfieldset({speed:"fast"});
        $('#fieldset5').coolfieldset({animation:false});
      </script>
    </body>
    </html>
    希望本文所述对大家jQuery程序设计有所帮助。
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/15 1:49:19