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

          jquery boxy 使用 轉載

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

          彈出對話框:


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


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


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

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

                  });
                        return false;
          });

          主站蜘蛛池模板: 盖州市| 襄垣县| 邯郸县| 惠安县| 壶关县| 永丰县| 吉安市| 宜兴市| 公主岭市| 舟山市| 庐江县| 唐海县| 万山特区| 辰溪县| 康保县| 广安市| 西华县| 中宁县| 濮阳市| 神木县| 高淳县| 星子县| 冕宁县| 红桥区| 漳州市| 德化县| 东明县| 丹巴县| 澄城县| 且末县| 牙克石市| 扎赉特旗| 灯塔市| 定结县| 马尔康县| 涟源市| 磐安县| 区。| 昌都县| 临桂县| 包头市|