{"id":2583,"date":"2015-09-29T17:04:17","date_gmt":"2015-09-29T09:04:17","guid":{"rendered":"http:\/\/blog.hoyo.idv.tw\/?p=2583"},"modified":"2020-04-29T08:28:12","modified_gmt":"2020-04-29T00:28:12","slug":"jquery-jbox","status":"publish","type":"post","link":"https:\/\/blog.hoyo.idv.tw\/?p=2583","title":{"rendered":"jQuery - jBox"},"content":{"rendered":"<p>\u5b98\u7db2 <a href=\"http:\/\/stephanwagner.me\/jBox\" target=\"_blank\" rel=\"noopener\">jBox by Stephan Wagner<\/a>\u00a0:\u00a0http:\/\/stephanwagner.me\/jBox<\/p>\n<pre class=\"h-align:2 toolbar:2 striped:false nums:false lang:default decode:true\">jBox is a powerful and flexible jQuery plugin,\r\ntaking care of all your popup windows, tooltips, notices and more.<\/pre>\n<p>&nbsp;<\/p>\n<p>\u4f7f\u7528 Modal \u5f37\u5236\u4f7f\u7528\u95dc\u9589\u6309\u9215\u3001\u5f31\u5316\u80cc\u666f\u3001\u6a19\u984c\u62d6\u66f3\u8996\u7a97<\/p>\n<pre class=\"lang:js decode:true\">&lt;script&gt;\r\n    $('#idBoss').jBox('Modal', {\r\n        title: \"\u5efa\u7acb\u516c\u53f8 \u57fa\u672c\u8cc7\u6599\",\r\n        width:600,\r\n        height:400,\r\n        blockScroll:false,\r\n        animation:'zoomIn',\r\n        draggable:'title',\r\n        closeButton:'title',\r\n        overlay:true,\r\n        closeOnClick:false,\r\n        content: $('#idModalBoss')\r\n    });\r\n&lt;\/script&gt;<\/pre>\n<p>--<\/p>\n<p><strong>\u61c9\u7528<\/strong><\/p>\n<pre class=\"nums:true lang:default decode:true\">&lt;div id=\"idList\" class=\"Hide\"&gt;\r\n    &lt;div id=\"idDate\"&gt;&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n\r\n&lt;script&gt;\r\n    $(function(){\r\n        var Width  = screen.width *0.8;\r\n        var Height = screen.height *0.65;\r\n        myModal = new JBox('Modal', {\r\n            title: \"\u8a73\u7d30\u8cc7\u6599\",\r\n            width:Width,\r\n            height:Height,\r\n            blockScroll:false,\r\n            fade:false,\r\n            animation:'',\r\n            draggable:'title',\r\n            closeButton:'title',\r\n            overlay:true,\r\n            closeOnClick:false,\r\n            content: $('#idList')\r\n        });\r\n    });\r\n    \r\n    $('.TableContent').click(function() {\r\n        var $this = $(this);\r\n        if ( $this.data('value') ) {\r\n            $('#idDate').html($this.data('value'));\r\n            myModal.open();\r\n        }\r\n    });\r\n&lt;\/script&gt;<\/pre>\n<p>jBox \u7684\u7269\u4ef6\u5316\u5fc5\u9808\u6ce8\u610f DOM \u7684\u8f09\u5165\u9806\u5e8f\uff0c\u5982\u679c\u767c\u751f\u7121\u6cd5\u8f09\u5165 content \u7684\u60c5\u6cc1\uff0c\u53ef\u80fd\u5c31\u662f DOM \u7684\u554f\u984c\u3002<\/p>\n<p>\u5c07 new jBox \u653e\u5728\u00a0$( document ).ready() \u5167\u518d\u8a66\u8a66\u770b<\/p>\n<p>--<\/p>\n<h2>\u91cd\u65b0\u8a2d\u5b9a<\/h2>\n<pre class=\"lang:js decode:true\">\/\/ \u5c07 EditModal jBox \u7269\u4ef6\u91cd\u65b0\u8a2d\u5b9a\u70ba\u5bec 600 \u9ad8 300 \u6a19\u984c\u6839\u64da\u8cc7\u6599\u91cd\u65b0\u8a2d\u5b9a\r\nEditModal.setWidth(600);\r\nEditModal.setHeight(300);\r\n\r\nEditModal.open().setTitle( $('#id_Save_Name').val()+' \u6703\u54e1\u8cc7\u6599', true);<\/pre>\n<p>--<\/p>\n<h2>\u95dc\u9589\u6309\u9215\u963b\u6b62\u5176\u4ed6\u4e8b\u4ef6\u89f8\u767c<\/h2>\n<pre class=\"lang:js decode:true\">onCloseComplete:function(){\r\n    event.preventDefault();\r\n}<\/pre>\n<p>--<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"2583\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;5,657&nbsp;total views<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5b98\u7db2 jBox by Step...<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"2583\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;5,657&nbsp;total views<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[262],"tags":[193,194],"_links":{"self":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2583"}],"collection":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2583"}],"version-history":[{"count":9,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2583\/revisions"}],"predecessor-version":[{"id":6887,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2583\/revisions\/6887"}],"wp:attachment":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}