posts - 66, comments - 12, trackbacks - 0, articles - 0

          jquery boxy 使用 轉(zhuǎn)載

          Posted on 2009-10-13 10:20 cyantide 閱讀(1323) 評論(0)  編輯  收藏 所屬分類: html、script

          彈出對話框:


          alert對話框
          Boxy.alert("內(nèi)容",動作);
          $('#ask-actuator').click(function() {
            Boxy.alert("Alert! Alert!", function() { alert("Alert closed!"); });
            return false;
            });


          確認(rèn)對話框
          Boxy.confirm("內(nèi)容",動作,{參數(shù)});
          $('#ask-actuator').click(function() {
            Boxy.confirm("Please confirm?", function() { alert("Confirmed!"); });
            return false;
            });


          //彈出詢問框
          Boxy.ask("內(nèi)容", {"按鈕值1":"按鈕1", "按鈕值":"按鈕2"}, "動作", {參數(shù)});
            $('#ask-actuator').click(function() {
              Boxy.ask("這里是詢問內(nèi)容?", ["按鈕1", "按鈕2", "按鈕3"], function(val) {
            if(val=="按鈕3"){
              alert('哈哈,被你選了');
            }else{
              alert("您選擇了按鈕"+val);
              }
              }, {title: "這里是標(biāo)題"});
              return false;
            });
          $('#ask-actuator').click(function() {
            Boxy.ask("這里是詢問內(nèi)容?",
                {"1":"按鈕1", "2":"按鈕2"},  //"1代表值"  "按鈕1"代表名稱
                function(val) { alert(val); },
                {title: "這里是標(biāo)題"}
                );
            return false;
          });

          自定義彈出對話框
          $('#cs').click(function() {
            
                        new Boxy("<div><a href='#' onclick='Boxy.get(this).hide();'>這里是內(nèi)容</a>"+
                  "<a href='#' onclick='Boxy.get(this).tween(400, 400);return false;'>變大</a></div>",
                  {
                    title:"你好",        //標(biāo)題
                  closeText:"[關(guān)閉]",            //關(guān)閉文字
                  modal:true,        //背景是否變暗
                  fixed:true,        //窗口是否固定
                  cache:true,        //是否被遮擋
                  draggable:true,      //這個設(shè)定窗口是否可以拖動,要定義title才有效,設(shè)定了modal就無效
                  center:true,        //彈出對話框是否居中
                  x:50,
                  y:50,            //設(shè)定窗口位置值為%多少,設(shè)定此后center會被覆蓋
                  afterDrop:function(){},    //關(guān)閉對話框后執(zhí)行的{IE下面關(guān)閉不了,原因不明}
                  afterShow:function(){},    //打開對話框后執(zhí)行的
                  afterHide:function(){}    //隱藏對話框后執(zhí)行的

                  });
                        return false;
          });

          主站蜘蛛池模板: 枣强县| 萝北县| 苍梧县| 石嘴山市| 宁强县| 临邑县| 临江市| 衡阳市| 长武县| 辽宁省| 含山县| 宁远县| 抚州市| 桃江县| 秭归县| 贵溪市| 海城市| 屯留县| 游戏| 徐水县| 马边| 九寨沟县| 静宁县| 南漳县| 襄垣县| 台山市| 英超| 比如县| 扬州市| 崇左市| 滦南县| 宿州市| 灵川县| 新源县| 贵溪市| 南城县| 即墨市| 浦江县| 安化县| 江油市| 苍溪县|