具有缩放jquery的悬停功能

时间:2013-05-31 22:19:20

标签: jquery html css css3 jquery-transit

我无法弄清楚这里有什么不对。

我做了这个小提琴:http://jsfiddle.net/iBertel/dyNxs/

通过为jquery添加一个传输脚本来解决它。你可以在这里下载一个:http://ricostacruz.com/jquery.transit/

HTML

<section class="slider-panel red-background">
    <div class="slider-caption-wrap">
        <div class="rollOver">  <span class="rollOverSymbol">x</span>
    <span class="rollOverSymbolBG"></span>

        </div>
    </div>
</section>

CSS

.slider-caption-wrap {
    background-color: #333;
    width:20%;
    height: 20%;
    position: absolute;
    overflow: hidden;
    bottom: 15%;
    left:15%;
}
.rollOver {
    position: absolute;
    z-index: 5;
    width: 100%;
    height: 100%;
    background: url("../img/overlayDottyDark.png") repeat scroll 0px 0px rgba(200, 57, 59, 0.8);
    overflow: hidden;
    opacity: 0;
}
.rollOverSymbol {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 50%;
    margin-left: -50px;
    margin-top: -50px;
    display: block;
    height: 100px;
    width: 100px;
    background-color: rgb(148, 41, 43);
    border-radius: 50% 50% 50% 50%;
    text-align: center;
    line-height: 100px;
    font-size: 72px;
    color: rgb(255, 255, 255);
}
.rollOverSymbolBG {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 50%;
    margin-left: -60px;
    margin-top: -60px;
    display: block;
    height: 120px;
    width: 120px;
    background-color: rgb(204, 72, 75);
    border-radius: 50% 50% 50% 50%;
}

JQUERY

$(".slider-caption-wrap").hover(

function () {
    $(".rollOver", this).css({
        opacity: 1
    });
    $(".rollOverSymbolBG", this).stop().transition({
        scale: 1
    }, 1400, 'easeOutCirc');
    $(".rollOverSymbol", this).stop().transition({
        scale: 1,
        rotate: '0deg'
    }, 500, 'easeOutCirc');
},

function () {
    $(".rollOverSymbolBG", this).stop().transition({
        scale: 4
    }, 600, 'easeOutCirc');
    $(".rollOverSymbol", this).stop().transition({
        scale: 2,
        rotate: '-45deg'
    }, 600, 'easeOutCirc');
    $(".rollOver", this).stop().transition({
        opacity: 0
    }, 300);
});

1 个答案:

答案 0 :(得分:0)

我认为你曾经将jquery.transit.js文件附加到小提琴......

工作演示: - http://jsfiddle.net/dyNxs/2/