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

jquery自定義插件——window的實(shí)現(xiàn)【示例代碼】

 更新時(shí)間:2016年05月06日 15:30:40   投稿:jingxian  
下面小編就為大家?guī)硪黄猨query自定義插件——window的實(shí)現(xiàn)【示例代碼】。小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考

本例子實(shí)現(xiàn)彈窗的效果:

1、jquery.show.js

/* 
 * 實(shí)現(xiàn)功能:點(diǎn)擊在鼠標(biāo)位置顯示div 
 * 版本序號:1.0 
 */
(function($){ 
  $.fn.showDIV = function(options){ 
    var defaults = {}; 
    var options = $.extend(defaults, options); 
    var showdiv=$(this); 
    var close, title, content; 
    close=$(" 
"); title=$(" 
"); content=$(" 
"); showdiv.html(""); showdiv.append(close); showdiv.append(title); showdiv.append(content); close.html("X"); title.html(options.title); content.html(options.content); showdiv.css("display","block"); showdiv.css("position","absolute"); showdiv.css("left",($(window).width()-options.width)/2+"px"); showdiv.css("top",($(window).height()-options.height)/2+"px"); showdiv.css("width",options.width); showdiv.css("height",options.height); close.bind("click",function(){ showdiv.css("display","none"); }); }; })(jQuery);

2、jquery.showdiv.css

body div 
{ 
  font-size:12px; 
  text-align:center; 
} 
#container 
{ 
  background-color:#CCC; 
  border:1px solid #000; 
  width:1024px; 
  height:600px; 
} 
#showdiv 
{ 
  background-color:#FF0; 
  width:100px; 
  height:100px; 
  display:none; 
  z-index:99; 
} 
.title 
{ 
  padding:10px; 
  background:#F39; 
  font-weight:bold; 
  text-align:center; 
  color:#FFF; 
} 
.close 
{ 
  margin:5px; 
  position:absolute; 
  right:0px; 
  top::0px; 
  padding:5px; 
  color:#000; 
  background:#FFF; 
} 
.close:hover 
{ 
  cursor:pointer; 
  background:#CCC; 
} 
.content 
{ 
  text-align:left; 
  padding:10px; 
}

3、demo.html

<script type="text/javascript" src="jquery/jquery.min.js"></script> 
<script type="text/javascript" src="jquery/jquery.showdiv.js"></script> 
<script type="text/javascript"> 
  $(document).ready(function (){  
    $('#show').bind("click", function(evt){ 
      var showdiv = $('#showdiv').showDIV({ 
        width:400, 
        height:200, 
        title:"我不是黃蓉", 
        content:"我不是黃蓉<BR>我不會(huì)武功<BR>我只要靖哥哥<BR>完美的愛情"
      }); 
    }); 
  }); 
</script> 
 
 
 
<INPUT id=show value=顯示 type=button name=showDiv>

實(shí)現(xiàn)后的效果如下:

以上這篇jquery自定義插件——window的實(shí)現(xiàn)【示例代碼】就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

兰州市| 天水市| 资溪县| 宝应县| 平塘县| 大姚县| 昌江| 尼勒克县| 德惠市| 玉环县| 西乌珠穆沁旗| 辉南县| 长兴县| 孙吴县| 兰溪市| 上高县| 星座| 灵台县| 乐山市| 萝北县| 陕西省| 扶沟县| 祁连县| 郸城县| 云南省| 奉贤区| 八宿县| 宝清县| 邓州市| 江油市| 嵩明县| 探索| 通山县| 乐昌市| 高要市| 白山市| 宁安市| 金山区| 惠来县| 九龙坡区| 宁蒗|