百度空间 | 百度首页 
 
查看文章
 
基于Jquery的Slide 第一次写英文 头晕.
2007年08月20日 星期一 20:04

    One day, I lounged in my PC.I found a Flash from my Flash8 folder like the picture right. It like a fade show. I thinked i could do it use Javascript too.So i worked on it immediately.

    I used Jquery.

it can really made you use less time to finnish more work, I like it!

    Two hours was done, the work was finished.i packaged the wedget.You can use it like this:

  • Import the jquery.js and the wedget js file

     <script src="jquery.js"></script>
            <script src="ppt.js"></script>

  • Bulid a div element in the page

        <div id="container"></div>


  • The last

        <script language="javascript">

          /* the contents upon the pictures. */

            var contentArray = ["<dt>Summer salad</dt><dd>Butter lettuce with apples, bloo</dd>",
                                         "<dt>Summer salad</dt><dd>Butter lettuce with apples, bloo</dd>"

                                         ];

          /* the pictures Array. */

           var imgArray = ["images/image0.jpg",
                                  "images/image1.jpg"

                                   ];

            /* Options */

          var options = {width:700,

                               height:150,

                                  size:"12px",

                                       opacity:0.8};

           /* Run!! */


           PPT("container", contentArray,imgArray,options);

        </script>

    That's all. you will see it with your IE or Firefox (yes!It can work in IE and Firefox) Figure A

,change the options {width:650;height:200,size:"13px",opacity:0.6} (Figure B)

Figure A

Figure B

    It's well done. when you click the next button on the panel, the current picture will fade out,and next one fade in. I also write another effect:slide Up and slide Down show, but i have not packaged that effect.You can view all effects in the file i uploaded. Click Here To Download All Files.

    Thanks.


类别:web2.0&js&ajax | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu