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

CSS+jQuery實(shí)現(xiàn)的一個(gè)放大縮小動(dòng)畫(huà)效果

 更新時(shí)間:2013年09月24日 11:35:16   作者:  
因?yàn)樾枨缶椭挥?個(gè)元素。如果是要用CSS的class來(lái)處理,那就需要用到CSS3動(dòng)畫(huà)了,好了下面為大家介紹下如何實(shí)現(xiàn)這個(gè)放大縮小動(dòng)畫(huà)效果
今天幫朋友寫(xiě)了一些代碼,自己覺(jué)得寫(xiě)著寫(xiě)著,好幾個(gè)版本以后,有點(diǎn)滿(mǎn)意,于是就貼出來(lái)。
都是定死了的。因?yàn)樾枨缶椭挥?個(gè)元素。如果是要用CSS的class來(lái)處理,那就需要用到CSS3動(dòng)畫(huà)了。
復(fù)制代碼 代碼如下:

<!DOCTYPE html>
<html>
<head>
<title> CSS+jQuery動(dòng)畫(huà)效果 </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="鐵錨">
<style>
body{
z-index: 0;
width: 100%;
min-height: 400px;
}
.pages{
position: absolute;
}
.current{
position: absolute;
z-index: 12 !important;
left: 0px !important;
}
.page1{
background-color: #a5cfff;
z-index: 1;
width: 300px;
height:280px;
top: 100px;
left: 0px;
}
.page2{
background-color: #b1ca54;
z-index: 2;
width: 250px;
height:270px;
top: 160px;
left: 0px;
}
.page3{
background-color: #c2c6c9;
z-index: 3;
width: 200px;
height:260px;
top: 220px;
left: 0px;
}
.page4{
background-color: #ef9e9c;
z-index: 4;
width: 150px;
height:250px;
top: 250px;
left: 0px;
}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(function(){
// 增長(zhǎng)
function increase($div,e){
var style = $div.attr("style");
$div.addClass("current").attr("styleold",style);
//
$div.stop();
$div.animate({
opacity:0.9,
width:"400px",
height: "400px",
top: "100px",
left: "0px"
},600)
.animate({
opacity:1.0
},30);

e.stopPropagation();
return false;
};
// 還原
function resize(e){
// 所有的都移除
var $page1 = $(".current.page1") ;
$page1.stop();
$page1.animate({
opacity:1.0,
width:"300px",
height: "280px",
top: "100px",
left: "0px"
},600,null,function(){
$page1.removeClass("current").attr("style","");
});

var $page2 = $(".current.page2") ;
$page2.stop();
$page2.animate({
opacity:1.0,
width:"250px",
height: "270px",
top: "160px",
left: "0px"
},600,null,function(){
$page2.removeClass("current").attr("style","");
});

var $page3 = $(".current.page3") ;
$page3.stop();
$page3.animate({
opacity:1.0,
width:"200px",
height: "260px",
top: "220px",
left: "0px"
},600,null,function(){
$page3.removeClass("current").attr("style","");
});

var $page4 = $(".current.page4") ;
$page4.stop();
$page4.animate({
opacity:1.0,
width:"150px",
height: "250px",
top: "250px",
left: "0px"
},600,null,function(){
$page4.removeClass("current").attr("style","");
});

e.stopPropagation();
return false;
};
//
$("#button1").unbind("mouseover").bind("mouseover",function(e){
//
var $page1 = $(".page1");
// 添加特定的
return increase($page1,e);

}).unbind("mouseout").bind("mouseout",function(e){
return resize(e);

});
//
$("#button2").unbind("mouseover").bind("mouseover",function(e){
//
var $page2 = $(".page2");
// 添加特定的
return increase($page2,e);

}).unbind("mouseout").bind("mouseout",function(e){
return resize(e);
});
//
$("#button3").unbind("mouseover").bind("mouseover",function(e){
//
var $page3 = $(".page3");
// 添加特定的
return increase($page3,e);

}).unbind("mouseout").bind("mouseout",function(e){
return resize(e);
});
//
$("#button4").unbind("mouseover").bind("mouseover",function(e){
//
var $page4 = $(".page4");
// 添加特定的
return increase($page4,e);

}).unbind("mouseout").bind("mouseout",function(e){
return resize(e);
});

//
$(".pages").unbind("mouseover").bind("mouseover",function(e){
//
var $this = $(this);
// 添加特定的
return increase($this,e);
}).unbind("mouseout").bind("mouseout",function(e){
// 所有的都移除
return resize(e);
});
//
$("body").click(function(e){
// 所有的都移除
return resize(e);
});
});
</script>
</head>

<body>
<div class="pages page1">page1</div>
<div class="pages page2">page2</div>
<div class="pages page3">page3</div>
<div class="pages page4">page4</div>

<div style="background-color: #a5cfff;">
<button id="button1">第一頁(yè)</button>
<button id="button2">第2頁(yè)</button>
<button id="button3">第3頁(yè)</button>
<button id="button4">第4頁(yè)</button>
</div>
</body>
</html>

相關(guān)文章

  • Jquery通過(guò)Ajax訪問(wèn)XML數(shù)據(jù)的小例子

    Jquery通過(guò)Ajax訪問(wèn)XML數(shù)據(jù)的小例子

    這篇文章主要介紹了Jquery通過(guò)Ajax訪問(wèn)XML數(shù)據(jù),有需要的朋友可以參考一下
    2013-11-11
  • jQuery插件zTree實(shí)現(xiàn)的基本樹(shù)與節(jié)點(diǎn)獲取操作示例

    jQuery插件zTree實(shí)現(xiàn)的基本樹(shù)與節(jié)點(diǎn)獲取操作示例

    這篇文章主要介紹了jQuery插件zTree實(shí)現(xiàn)的基本樹(shù)與節(jié)點(diǎn)獲取操作,結(jié)合實(shí)例形式分析了jQuery樹(shù)形插件zTree構(gòu)造基本樹(shù)與針對(duì)節(jié)點(diǎn)的獲取操作相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下
    2017-03-03
  • jquery的extend和fn.extend的使用說(shuō)明

    jquery的extend和fn.extend的使用說(shuō)明

    jQuery.fn.extend(object); 對(duì)jQuery.prototype進(jìn)得擴(kuò)展,就是為jQuery類(lèi)添加“成員函數(shù)”。jQuery類(lèi)的實(shí)例可以使用這個(gè)“成員函數(shù)”。
    2011-01-01
  • jquery+swiper組件實(shí)現(xiàn)時(shí)間軸滑動(dòng)年份tab切換效果

    jquery+swiper組件實(shí)現(xiàn)時(shí)間軸滑動(dòng)年份tab切換效果

    這篇文章主要介紹了jquery+swiper組件實(shí)現(xiàn)時(shí)間軸滑動(dòng)年份tab切換效果,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2021-12-12
  • jquery 仿QQ校友的DIV模擬窗口效果源碼

    jquery 仿QQ校友的DIV模擬窗口效果源碼

    本文使用大名頂頂?shù)膉query來(lái)實(shí)現(xiàn)QQ校友的DIV模擬窗口,QQ的檢驗(yàn)一些都是非常棒的
    2010-03-03
  • 詳解jQuery的表單驗(yàn)證插件--Validation

    詳解jQuery的表單驗(yàn)證插件--Validation

    jQuery Validate 插件為表單提供了強(qiáng)大的驗(yàn)證功能,讓客戶(hù)端表單驗(yàn)證變得更簡(jiǎn)單,同時(shí)提供了大量的定制選項(xiàng),滿(mǎn)足應(yīng)用程序各種需求。本文主要對(duì)表單驗(yàn)證插件-Validation進(jìn)行案例分析,詳細(xì)介紹,具有很好的參考價(jià)值,需要的朋友一起來(lái)看下吧
    2016-12-12
  • JQuery拖拽元素改變大小尺寸實(shí)現(xiàn)代碼

    JQuery拖拽元素改變大小尺寸實(shí)現(xiàn)代碼

    "元素拖拽改變大小"其實(shí)和"元素拖拽"一個(gè)原理,以下附出源碼原型,弄明白了原理再擴(kuò)展其他實(shí)際應(yīng)用,思路就變得簡(jiǎn)單、清晰得多了
    2012-12-12
  • jQuery操作value值方法介紹

    jQuery操作value值方法介紹

    這篇文章介紹了jQuery操作value值的方法,文中通過(guò)示例代碼介紹的非常詳細(xì)。對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-03-03
  • jquery使用jxl插件導(dǎo)出excel示例

    jquery使用jxl插件導(dǎo)出excel示例

    這篇文章主要介紹了jquery使用jxl插件導(dǎo)出excel的具體實(shí)現(xiàn)步驟,需要的朋友可以參考下
    2014-04-04
  • jquery實(shí)現(xiàn)直播彈幕效果

    jquery實(shí)現(xiàn)直播彈幕效果

    這篇文章主要為大家詳細(xì)介紹了jquery實(shí)現(xiàn)直播彈幕效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-11-11

最新評(píng)論

区。| 江北区| 平定县| 阿拉善右旗| 原阳县| 韩城市| 当雄县| 英超| 武邑县| 苗栗县| 潼关县| 沙田区| 子洲县| 青海省| 萨迦县| 南阳市| 黑河市| 绍兴县| 额济纳旗| 高台县| 城口县| 新乡市| 临西县| 自治县| 清丰县| 山西省| 武宣县| 襄汾县| 赤水市| 汾阳市| 湘乡市| 乐都县| 淮安市| 南溪县| 额敏县| 大丰市| 阳春市| 旬邑县| 庐江县| 县级市| 沙田区|