欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery實現(xiàn)點擊彈出帶標(biāo)題欄的彈出層(從右上角飛入)效果

 更新時間:2015年09月19日 10:31:24   作者:企鵝  
這篇文章主要介紹了jquery實現(xiàn)點擊彈出帶標(biāo)題欄的彈出層(從右上角飛入)效果,涉及jQuery響應(yīng)鼠標(biāo)事件操作頁面元素動畫效果的實現(xiàn)技巧,需要的朋友可以參考下

本文實例講述了jquery實現(xiàn)點擊彈出帶標(biāo)題欄的彈出層(從右上角飛入)效果。分享給大家供大家參考。具體如下:

這是一款jquery實現(xiàn)的彈出層,點擊文字后從網(wǎng)頁右上角飛入,也可以說是滑入,此類彈出框帶有關(guān)閉按鈕,可自定義標(biāo)題欄和彈出框內(nèi)容,風(fēng)格自己可定義,代碼簡潔,基于jquery實現(xiàn),學(xué)習(xí)參考價值大,也可拿出即用。

運行效果截圖如下:

在線演示地址如下:

http://demo.jb51.net/js/2015/jquery-fade-in-title-info-stye-alert-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>
<title>jQuery從頁面右上角彈出的浮層代碼</title> 
<style>
*{margin:0;padding:0;list-style-type:none;}
body{font-family:'microsoft yahei';}
a{text-decoration:none;}
.showdiv{color:#fff;padding:8px 15px;background:#09F;text-align:center;display:block;width:150px;margin:100px auto;}
.showbox{width:0px;height:0px;display:none;position:absolute;right:0;top:0;z-index:100;border:1px #8FA4F5 solid;padding:1px;background:#fff;}
.showbox h2{height:25px;font-size:14px;background-color:#3366cc;position:relative;padding-left:10px;line-height:25px;color:#fff;}
.showbox h2 a{position:absolute;right:5px;top:0;font-size:12px;color:#fff;}
.showbox .mainlist{padding:10px;}
.showbox .mainlist p{font:normal 14px/2 'microsoft yahei';text-indent:2em;color:#333;padding-top:5px;}
#zhezhao{background-color:#666;position:absolute;z-index:99;left:0;top:0;display:none;width:100%;height:100%;opacity:0.5;filter: alpha(opacity=50);-moz-opacity: 0.5;}
</style>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
 $(".showdiv").click(function(){
  var box =300;
  var th= $(window).scrollTop()+$(window).height()/1.6-box;
  var h =document.body.clientHeight;
  var rw =$(window).width()/2-box;
  $(".showbox").animate({top:th,opacity:'show',width:600,height:340,right:rw},500);
  $("#zhezhao").css({
   display:"block",height:$(document).height()
  });
  return false;
 });
 $(".showbox .close").click(function(){
  $(this).parents(".showbox").animate({top:0,opacity: 'hide',width:0,height:0,right:0},500);
  $("#zhezhao").css("display","none");
 });
});
</script>
</head>
<body>
 <a class="showdiv" href="#">點擊我彈出浮層</a>
 <div class="showbox">
  <h2>腳本之家簡介<a class="close" href="#">關(guān)閉</a></h2>
  <div class="mainlist">
   <p>腳本之家是國內(nèi)專業(yè)的網(wǎng)站建設(shè)資源、腳本編程學(xué)習(xí)類網(wǎng)站,提供最新的網(wǎng)絡(luò)編程、腳本編程、網(wǎng)頁制作、網(wǎng)頁設(shè)計、網(wǎng)頁特效,為站長與網(wǎng)絡(luò)編程從業(yè)者提供學(xué)習(xí)資料。
</p>
  </div>
 </div> 
 <div id="zhezhao"></div>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
</div>
</body>
</html>

希望本文所述對大家的jQuery程序設(shè)計有所幫助。

相關(guān)文章

最新評論