jQuery图片轮播加悬停效果

jQuery图片轮播加悬停效果

dreamweaver免费视频教程:

51RGB Dreamweaver板块

加讨论群390180913 入群即可参加周一至周五免费公开课并获得免费视频 绝对干货!

 

jQuery图片轮播加悬停效果

使用方法

1.将文档内内部样式表保存到目录css下的style.css文件中,并在页面中链接到这个样式表文件

<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />

2.添加jquery.SuperSlide2.js

<script type="text/javascript" src="js/jquery.SuperSlide2.js"></script>

3.添加图片效果js(可根据实际情况整理到外部js文件中)

$(document).ready(function () {

     

    /* 图片滚动效果 */

    $(".mr_frbox").slide({

        titCell: "",

        mainCell: ".mr_frUl ul",

        autoPage: true,

        effect: "leftLoop",

        autoPlay: true,

        vis: 4

    });

     

    /* 鼠标悬停图片效果 */

    $(".mr_zhe_hover").css("top", $('.mr_zhe').eq(0).height());

    $("li").mouseout(function (e) {

        if ((e.pageX < $(this).offset().left || e.pageX > ($(this).offset().left + $(this).width())) || (e.pageY < $(this).offset().top || e.pageY > ($(this).offset().top + $(this).height()))) {

            $(this).find('.mr_zhe_i').show();

            $(this).find('.mr_zhe_hover').hide().stop().animate({ top: '190px' }, { queue: false, duration: 190 });

            return false;

        }

 

    });

    $('.mr_zhe').mouseover(function (event) {

        $(this).find('.mr_zhe_i').hide();

        $(this).find('.mr_zhe_hover').show().stop().animate({ top: '190px' }, { queue: false, duration: 190 });

        return false;

    });

     

});

 

4.html部分

<div class="friend">

    <div class="mr_frbox">

        <img class="mr_frBtnL prev" src="images/mfrl.gif" />

        <div class="mr_frUl">

            <ul id="mr_fu">

                <li><a href="http://www.jq22.com/">

                    <img src="images/i.jpg" />

                </a>

                    <div class="mr_zhe">

                        <div class="mr_zhe_i">

                            <h1>

                                I</h1>

                            <div class="mr_zhe_p">

                                <h3>

                                    <span>家居软装设计概念</span>Introduction soft home design</h3>

                            </div>

                        </div>

                        <div class="mr_zhe_hover">

                            <h1>

                                <img src="images/plus.gif"></h1>

                            <div class="mr_zhe_p">

                                <h3>

                                    <span>家居软装设计概念</span>Introduction soft home design</h3>

                            </div>

                        </div>

                    </div>

                </li>

                <li><a href="http://www.jq22.com/">

                    <img src="images/i2.jpg" />

                </a>

                    <div class="mr_zhe">

                        <div class="mr_zhe_i">

                            <h1>

                                E</h1>

                            <div class="mr_zhe_p">

                                <h3>

                                    <span>家居软装设计概念</span>Introduction soft home design</h3>

                            </div>

                        </div>

                        <div class="mr_zhe_hover">

                            <h1>

                                <img src="images/plus.gif"></h1>

                            <div class="mr_zhe_p">

                                <h3>

                                    <span>家居软装设计概念</span>Introduction soft home design</h3>

                            </div>

                        </div>

                    </div>

                </li>

                <li><a href="http://www.jq22.com/">

                    <img src="images/i3.jpg" />

                </a>

                    <div class="mr_zhe">

                        <div class="mr_zhe_i">

                            <h1>

                                S</h1>

                            <div class="mr_zhe_p">

                                <h3>

                                    <span>家居软装设计概念</span>Introduction soft home design</h3>

                            </div>

                        </div>

                        <div class="mr_zhe_hover">

                            <h1>

                                <img src="images/plus.gif"></h1>

                            <div class="mr_zhe_p">

                                <h3>

                                    <span>家居软装设计概念</span>Introduction soft home design</h3>

                            </div>

                        </div>

                    </div>

                </li>

                <li><a href="http://www.jq22.com/">

                    <img src="images/i4.jpg" />

                </a>

                    <div class="mr_zhe">

                        <div class="mr_zhe_i">

                            <h1>

                                A</h1>

                            <div class="mr_zhe_p">

                                <h3>

                                    <span>家居软装设计概念</span>Introduction soft home design</h3>

                            </div>

                        </div>

                        <div class="mr_zhe_hover">

                            <h1>

                                <img src="images/plus.gif"></h1>

                            <div class="mr_zhe_p">

                                <h3>

                                    <span>家居软装设计概念</span>Introduction soft home design</h3>

                            </div>

                        </div>

                    </div>

                </li>

            </ul>

        </div>

        <img class="mr_frBtnR next" src="images/mfrr.gif" />

    </div>

</div>

 

代码压缩包下载地址:

http://www.51rgb.com/nbbs/thread-1712-1-1.html

光看文字怎么够 来看在线视频 手把手教你做网站!

Adobe官方讲师万晨曦指导 轻松幽默学习网站开发

Dreamweaver视频直达网址 :51RGB Dreamweaver板块

 

 


你可能感兴趣的:(jquery,html5,Dreamweaver,网页设计,网页制作教程)