• <sub id="h4knl"><ol id="h4knl"></ol></sub>
    <sup id="h4knl"></sup>
      <sub id="h4knl"></sub>

      <sub id="h4knl"><ol id="h4knl"><em id="h4knl"></em></ol></sub><s id="h4knl"></s>
      1. <strong id="h4knl"></strong>

      2. 關(guān)jQuery彈出窗口簡(jiǎn)單實(shí)現(xiàn)代碼-javascript編程

        時(shí)間:2024-06-07 04:08:02 jQuery Mobile 我要投稿
        • 相關(guān)推薦

        關(guān)jQuery彈出窗口簡(jiǎn)單實(shí)現(xiàn)代碼-javascript編程

          今天講了Jquery的彈出窗口的組成和用法:

          先把引用文件的代碼寫(xiě)好:

          // 每個(gè)彈窗的標(biāo)識(shí)var x =0;var idzt = new Array();var Window = function(config){//ID不重復(fù)idzt[x] = "zhuti"+x; //彈窗ID//初始化,接收參數(shù)this.config = {width : config.width || 300, //寬度height : config.height || 200, //高度buttons : config.buttons || '', //默認(rèn)無(wú)按鈕title : config.title || '標(biāo)題', //標(biāo)題content : config.content || '內(nèi)容', //內(nèi)容isMask : config.isMask == falsefalse:config.isMask || true, //是否遮罩isDrag : config.isDrag == falsefalse:config.isDrag || true, //是否移動(dòng)};//加載彈出窗口var w = ($(window).width()-this.config.width)/2;var h = ($(window).height()-this.config.height)/2;var nr = "

          ";$("body").append(nr);//加載彈窗標(biāo)題var content ="

          "+this.config.title+"

          ×

          ";//加載彈窗內(nèi)容var nrh = this.config.height - 75;content = content+"

          "+this.config.content+"

          ";//加載按鈕content = content+"

          "+this.config.buttons+"

          ";//將標(biāo)題、內(nèi)容及按鈕添加進(jìn)窗口$('#'+idzt[x]).html(content);//創(chuàng)建遮罩層if(this.config.isMask){var zz = "

          ";$("body").append(zz);$("#zz").css('display','block');}//最大最小限制,以免移動(dòng)到頁(yè)面外var maxX = $(window).width()-this.config.width;var maxY = $(window).height()-this.config.height;var minX = 0,minY = 0;//窗口移動(dòng)if(this.config.isDrag){//鼠標(biāo)移動(dòng)彈出窗$(".title").bind("mousedown",function(e){var n = $(this).attr("bs"); //取標(biāo)識(shí)//使選中的到最上層$(".zhuti").css("z-index",3);$('#'+idzt[n]).css("z-index",4);//取初始坐標(biāo)var endX = 0, //移動(dòng)后X坐標(biāo)endY = 0, //移動(dòng)后Y坐標(biāo)startX = parseInt($('#'+idzt[n]).css("left")), //彈出層的初始X坐標(biāo)startY = parseInt($('#'+idzt[n]).css("top")), //彈出層的初始Y坐標(biāo)downX = e.clientX, //鼠標(biāo)按下時(shí),鼠標(biāo)的X坐標(biāo)downY = e.clientY; //鼠標(biāo)按下時(shí),鼠標(biāo)的Y坐標(biāo)//綁定鼠標(biāo)移動(dòng)事件$("body").bind("mousemove",function(es){endX = es.clientX - downX + startX; //X坐標(biāo)移動(dòng)end

        《&.doc》
        将本文的Word文档下载到电脑,方便收藏和打印
        推荐度:
        点击下载文档

        【關(guān)jQuery彈出窗口簡(jiǎn)單實(shí)現(xiàn)代碼-javascript編程】相關(guān)文章:

        JavaScript實(shí)現(xiàn)網(wǎng)頁(yè)刷新代碼段03-25

        關(guān)于ASP.NET使用JavaScript顯示信息提示窗口實(shí)現(xiàn)原理及代碼03-30

        常用排序算法之JavaScript實(shí)現(xiàn)代碼段03-10

        jquery提交按鈕的代碼03-30

        淺析jQuery 遍歷函數(shù)javascript03-29

        高效編寫(xiě)JavaScript代碼的技巧03-10

        在Java中執(zhí)行JavaScript代碼04-01

        基于jQuery的固定表格頭部的代碼03-30

        javascript編程異常處理的方法03-31

        在线咨询
        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码
      3. <sub id="h4knl"><ol id="h4knl"></ol></sub>
        <sup id="h4knl"></sup>
          <sub id="h4knl"></sub>

          <sub id="h4knl"><ol id="h4knl"><em id="h4knl"></em></ol></sub><s id="h4knl"></s>
          1. <strong id="h4knl"></strong>

          2. 亚洲人成电影网久久影视 | 日本三日本三级少妇三级66 | 在线视频欧美一二 | 日韩亚洲欧美在线 | 人人狠狠综合久久88亚洲 | 亚洲激情激情在线 |

            關(guān)jQuery彈出窗口簡(jiǎn)單實(shí)現(xiàn)代碼-javascript編程

              今天講了Jquery的彈出窗口的組成和用法:

              先把引用文件的代碼寫(xiě)好:

              // 每個(gè)彈窗的標(biāo)識(shí)var x =0;var idzt = new Array();var Window = function(config){//ID不重復(fù)idzt[x] = "zhuti"+x; //彈窗ID//初始化,接收參數(shù)this.config = {width : config.width || 300, //寬度height : config.height || 200, //高度buttons : config.buttons || '', //默認(rèn)無(wú)按鈕title : config.title || '標(biāo)題', //標(biāo)題content : config.content || '內(nèi)容', //內(nèi)容isMask : config.isMask == falsefalse:config.isMask || true, //是否遮罩isDrag : config.isDrag == falsefalse:config.isDrag || true, //是否移動(dòng)};//加載彈出窗口var w = ($(window).width()-this.config.width)/2;var h = ($(window).height()-this.config.height)/2;var nr = "

              ";$("body").append(nr);//加載彈窗標(biāo)題var content ="

              "+this.config.title+"

              ×

              ";//加載彈窗內(nèi)容var nrh = this.config.height - 75;content = content+"

              "+this.config.content+"

              ";//加載按鈕content = content+"

              "+this.config.buttons+"

              ";//將標(biāo)題、內(nèi)容及按鈕添加進(jìn)窗口$('#'+idzt[x]).html(content);//創(chuàng)建遮罩層if(this.config.isMask){var zz = "

              ";$("body").append(zz);$("#zz").css('display','block');}//最大最小限制,以免移動(dòng)到頁(yè)面外var maxX = $(window).width()-this.config.width;var maxY = $(window).height()-this.config.height;var minX = 0,minY = 0;//窗口移動(dòng)if(this.config.isDrag){//鼠標(biāo)移動(dòng)彈出窗$(".title").bind("mousedown",function(e){var n = $(this).attr("bs"); //取標(biāo)識(shí)//使選中的到最上層$(".zhuti").css("z-index",3);$('#'+idzt[n]).css("z-index",4);//取初始坐標(biāo)var endX = 0, //移動(dòng)后X坐標(biāo)endY = 0, //移動(dòng)后Y坐標(biāo)startX = parseInt($('#'+idzt[n]).css("left")), //彈出層的初始X坐標(biāo)startY = parseInt($('#'+idzt[n]).css("top")), //彈出層的初始Y坐標(biāo)downX = e.clientX, //鼠標(biāo)按下時(shí),鼠標(biāo)的X坐標(biāo)downY = e.clientY; //鼠標(biāo)按下時(shí),鼠標(biāo)的Y坐標(biāo)//綁定鼠標(biāo)移動(dòng)事件$("body").bind("mousemove",function(es){endX = es.clientX - downX + startX; //X坐標(biāo)移動(dòng)end