jquery實現隱藏在左側的彈性快顯功能表效果_jquery

來源:互聯網
上載者:User

本文執行個體講述了jquery實現隱藏在左側的彈性快顯功能表效果。分享給大家供大家參考。具體如下:

這是一款隱藏在左側的彈性快顯功能表,從淘寶扣下來的,也可作為JavaScript緩衝動畫的典型教程。本彈性菜單可擴充性強,實際上不光可以做成菜單,也可布局一些圖文混排的內容或一段視頻,總之被彈出的內容是在一段Div內,怎麼布置就看你的了。

運行效果截圖如下:

線上示範地址如下:

http://demo.jb51.net/js/2015/jquery-left-hidden-alert-adv-codes/

具體代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>隱藏在左側的彈性快顯功能表</title><script type="text/javascript" src="jquery1.3.2.js"></script><script language="javascript">$(function(){ $("#clickopen").click(function(){  var offset=$("#clickopen").offset().top;  $("#page").css("top",offset+"px");  $("#clickopen").hide();  $("#page").animate({   width: "400px",  height: "400px",  left: ($("body").width()/2-200)+"px",  top: (offset-100)+"px",  opacity: 'toggle'   }, 300 );  return false; }) $("#closepage").click(function(){  var offset=$("#page").offset().top;  $("#page").animate({   width: "0px",  height: "0px",  left: "0px",  top: (offset+100)+"px",  opacity: 'toggle'   }, 300 );  $("#clickopen").show();  return false; })})</script><style>body{text-align:center;font-size:12px;color:#333;font-family:"宋體";background:#fff;margin:0 auto;padding:0;}body > div{text-align:center;margin-right:auto;margin-left:auto;}div,form,ul,ol,li,span,p,dt,dd,dl{border:0;margin:0;padding:0;}img,a img{border:0;margin:0;padding:0;}h1,h2,h3,h4,h5,h6{font-size:12px;font-weight:400;margin:0;padding:0;}ul,ol,li{list-style:none;}td{word-break:break-all;}a{color:#003cc8;text-decoration:none;}a:hover{text-decoration:underline;color:blue;}.f_tahoma{font-family:Tahoma;}em,i{font-style:normal;}.ask{overflow:hidden;position:fixed;left:0px;top:200px;z-index:2}.leftButton{background:red;width:20px;height:80px;text-align:center;line-height:20px;display:block;color:#fff; }.content{background:#999;width:800px;height:2000px;margin:0 auto}* html,* html body /* 修正IE6震動bug */{background-image:url(about:blank);background-attachment:fixed;}.ask{_position:absolute;_bottom:auto;_left:0;_top: expression(documentElement.scrollTop + 200 + "px");}.page{width:0px; position:absolute;height:0px;left:0;top:0px;z-index:1;overflow:hidden;display:none}.page div{border:1px solid #000;overflow:hidden;width:398px}.page h1{height:40px;text-align:center;font-size:20px;color:#fff;background:red;line-height:40px}.page h1 a{float:right;color:#000;margin-top:-15px}.page p{padding:10px;line-height:22px;font-size:14px;text-align:left;background:#fff;height:400px;width:378px}</style></head><body><div class="ask"><a class="leftButton" href="#" id="clickopen">點擊彈出</a></div><div class="content"></div><div class="page" id="page"> <div>  <h1><a href="#" id="closepage">x</a>您好,歡迎光臨!</h1>  <p>雲棲社區是國內專業的網站建設資源、指令碼編程學習類網站,提供最新的網路編程、指令碼編程、網頁製作、網頁設計、網頁特效,為站長與網路編程從業者提供學習資料。</p> </div></div></body></html>

希望本文所述對大家的jQuery程式設計有所協助。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.