最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jquery實現(xiàn)邊框特效

 更新時間:2022年01月20日 10:55:52   作者:我叫陳小皮。  
這篇文章主要為大家詳細介紹了jquery實現(xiàn)邊框特效,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了jquery實現(xiàn)邊框特效的具體代碼,供大家參考,具體內容如下

主要思想

1.將四個div分別定位到大div的上下左右位置
2.分別設置成寬度為0或者高度為0
3.讓其執(zhí)行給定動畫,即多少毫秒讓寬度或者高度變?yōu)橹付ǖ拈L度

html代碼

<div class="box">
? ? <div class="border_top"></div>
? ? <div class="border_bottom"></div>
? ? <div class="border_left"></div>
? ? <div class="border_right"></div>
</div>

css代碼

.box{
? ? ? ? width:234px;
? ? ? ? height:300px;
? ? ? ? position:relative;
}
.border_bottom,.border_left,.border_right,.border_top{
? ? background: #ff6700;
? ? position: absolute;
? ? font-size: 0px;
? ? transition: all 0.5s ease-out;
? ? z-index: 99;
}
.border_bottom,.border_top{
? ? height: 1px;
? ? width: 0px;
}
.border_right,.border_left{
? ? height: 0px;
? ? width: 1px;
}
.border_top {
? ? top:0px;
? ? left:0px;
}
.border_right {
? ? top:0px;
? ? right:0px;
}
.border_bottom {
? ? right: 0px;
? ? bottom: 0px;
}
.border_left {
? ? left: 0px;
? ? bottom: 0px;
}

js實現(xiàn)效果

1.引入jquery文件

<script src="jquery-1.8.3.min.js"></script>

2.jquery代碼

$('.main>li').hover(function(){
? ? var index=$(this).index();
? ? $(".border_top").stop(true,true);
? ? $(".border_left").stop(true,true);
? ? $(".border_bottom").stop(true,true);
? ? $(".border_right").stop(true,true);
? ? $(".border_top").eq(index).animate({width:"234px"},100)
? ? $(".border_left").eq(index).animate({height:"300px"},100)
? ? $(".border_bottom").eq(index).animate({width:"234px"},100)
? ? $(".border_right").eq(index).animate({height:"300px"},100)
},function(){
? ? var index=$(this).index();
? ? $(".border_top").stop(true,true);
? ? $(".border_left").stop(true,true);
? ? $(".border_bottom").stop(true,true);
? ? $(".border_right").stop(true,true);
? ? $(".border_top").eq(index).animate({width:"0"},100)
? ? $(".border_left").eq(index).animate({height:"0"},100)
? ? $(".border_bottom").eq(index).animate({width:"0"},100)
? ? $(".border_right").eq(index).animate({height:"0"},100)
});

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關文章

最新評論

黄骅市| 托克逊县| 聂拉木县| 阜南县| 项城市| 乐陵市| 阿鲁科尔沁旗| 嫩江县| 东乌| 清涧县| 九江县| 贡觉县| 河曲县| 荔浦县| 德令哈市| 东乌珠穆沁旗| 共和县| 通榆县| 南陵县| 德保县| 郓城县| 吴川市| 天等县| 韶山市| 徐汇区| 临泉县| 米泉市| 河北区| 玛纳斯县| 巴中市| 黎平县| 仁化县| 阳江市| 惠水县| 武清区| 嘉禾县| 双流县| 义乌市| 运城市| 宾阳县| 鄂伦春自治旗|