{"id":177,"date":"2014-02-20T11:08:11","date_gmt":"2014-02-20T02:08:11","guid":{"rendered":"http:\/\/css.programming.jp\/?p=177"},"modified":"2015-02-27T17:34:09","modified_gmt":"2015-02-27T08:34:09","slug":"lightbox-%e3%82%bf%e3%82%a4%e3%83%97%e3%83%95%e3%82%a9%e3%83%88%e3%82%ae%e3%83%a3%e3%83%a9%e3%83%aa%e3%83%bc","status":"publish","type":"post","link":"https:\/\/css.programming.jp\/?p=177","title":{"rendered":"LightBox \u30bf\u30a4\u30d7\u30d5\u30a9\u30c8\u30ae\u30e3\u30e9\u30ea\u30fc"},"content":{"rendered":"<p>\u7686\u69d8\u304a\u306a\u3058\u307f\u306eLightBox\uff08\u753b\u9762\u306f\u305d\u306e\u307e\u307e\u3067\u3001\u753b\u9762\u4e2d\u592e\u306b\u5927\u304d\u3044\u30a4\u30e1\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u306e\u306b\u4f7f\u7528\u3055\u308c\u308bJavaScript\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\uff09\u30bf\u30a4\u30d7\u306e\u30d5\u30a9\u30c8\u30ae\u30e3\u30e9\u30ea\u30fc\u3067\u3042\u308b\u3002<\/p>\n<p>  <input type=\"radio\" id=\"r1\" name=\"gal\"><br \/>\n  <input type=\"radio\" id=\"r2\" name=\"gal\"><br \/>\n  <input type=\"radio\" id=\"r3\" name=\"gal\"><br \/>\n  <input type=\"radio\" id=\"r4\" name=\"gal\"><br \/>\n  <input type=\"radio\" id=\"r5\" name=\"gal\"><br \/>\n  <input type=\"radio\" id=\"r6\" name=\"gal\"><br \/>\n  <input type=\"radio\" id=\"r7\" name=\"gal\"><\/p>\n<div id=\"thumbs\">\n    <label for=\"r1\"><img decoding=\"async\" src=\"wp-images\/s1.jpg\"><\/label><br \/>\n    <label for=\"r2\"><img decoding=\"async\" src=\"wp-images\/s2.jpg\"><\/label><br \/>\n    <label for=\"r3\"><img decoding=\"async\" src=\"wp-images\/s3.jpg\"><\/label><br \/>\n    <label for=\"r4\"><img decoding=\"async\" src=\"wp-images\/s4.jpg\"><\/label><br \/>\n    <label for=\"r5\"><img decoding=\"async\" src=\"wp-images\/s5.jpg\"><\/label>\n  <\/div>\n<div id=\"frame\">\n<div id=\"photo1\"><img decoding=\"async\" src=\"wp-images\/1.jpg\"><span class=\"title\">1\/5\u3000\u3000\u3000\u671d\u713c\u3051\u306e\u91dd\u306e\u6728\u5cb3<\/span><\/div>\n<div id=\"photo2\"><img decoding=\"async\" src=\"wp-images\/2.jpg\"><span class=\"title\">2\/5\u3000\u3000\u3000\u91dd\u30ce\u6728\u5cb3\u3001\u30b9\u30d0\u30ea\u5cb3\u3092\u80cc\u306b\u5ca9\u5c0f\u5c4b\u6ca2\u5cb3\u3078\u306e\u767b\u308a<\/span><\/div>\n<div id=\"photo3\"><img decoding=\"async\" src=\"wp-images\/3.jpg\"><span class=\"title\">3\/5\u3000\u3000\u3000\u5263\u5cb3\u3092\u771f\u8fd1\u306b\u671b\u3080<\/span><\/div>\n<div id=\"photo4\"><img decoding=\"async\" src=\"wp-images\/4.jpg\"><span class=\"title\">4\/5\u3000\u3000\u3000\u9e7f\u5cf6\u69cd\u30f6\u5cb3\u3001\u5f8c\u7acb\u5c71\u9023\u5cf0<\/span><\/div>\n<div id=\"photo5\"><img decoding=\"async\" src=\"wp-images\/5.jpg\"><span class=\"title\">5\/5\u3000\u3000\u3000\u5ca9\u5c0f\u5c4b\u6ca2\u3001\u9cf4\u6ca2\u5cb3\u3092\u80cc\u306b\u5cb3\u723a\u30f6\u5cb3\u3078\u306e\u767b\u308a<\/span><\/div>\n<div id=\"close_btn\"><label for=\"r6\">\u2613 \u9589\u3058\u308b<\/label><\/div>\n<\/p><\/div>\n<p>  <label for=\"r7\"><\/p>\n<div id=\"darkscreen\"><\/div>\n<p><\/label><\/p>\n<style type=\"text\/css\">\n#thumbs {\n\tposition: relative;\n\twidth: 630px;\n\tleft: 20px;\n\tmargin:0 auto;\n}\n#thumbs label img {\n\tcursor: pointer;\n}\n#r1, #r2, #r3, #r4, #r5,#r6,#r7 {\n\tdisplay: none;\n}\n#photo1, #photo2, #photo3, #photo4, #photo5 {\n\tposition: absolute;\n\ttop:0;\n\tmargin:5px 5px 0 5px;\n\topacity: 0;\n\t-webkit-transition: opacity 1s ease;\n\t-moz-transition: opacity 1s ease;\n\t-o-transition: opacity 1s ease;\n\ttransition: opacity 1s ease;\n}\n#r1:checked ~ #frame,#r2:checked ~ #frame,#r3:checked ~ #frame,#r4:checked ~ #frame,#r5:checked ~ #frame {\n\tz-index:99;\n\topacity:1;\n}\n#r1:checked ~ #frame #photo1, #r2:checked ~ #frame #photo2, #r3:checked ~ #frame #photo3, #r4:checked ~ #frame #photo4, #r5:checked ~ #frame #photo5 {\n\topacity: 1;\n\tz-index:100;\n}\n#r1:checked ~ label #darkscreen,#r2:checked ~ label #darkscreen,#r3:checked ~ label #darkscreen,#r4:checked ~ label #darkscreen,#r5:checked ~ label #darkscreen {\n\topacity:0.6;\n\tz-index:90;\n}\n#frame {\n\tposition:fixed !important;\n\tposition:absolute;\n\tbackground:#fff;\n\twidth:610px;\n\theight:370px;\n\tleft:50%;\n\ttop:50%;\n\tmargin-left:-305px;\n\tmargin-top:-170px;\n\topacity:0;\n\tz-index:-11;\n}\n.title {\n\tposition:absolute;\n\tleft:10px;\n\ttop:345px;\n\tfont-size:12px;\n}\n#close_btn label {\n\tposition:absolute;\n\tleft:540px;\n\ttop:350px;\n\tfont-size:14px;\n\tfont-weight:bold;\n\tcursor:pointer;\n}\n#darkscreen {\n\tposition:fixed !important;\n\tposition:absolute;\n\twidth:100%;\n\theight:100%;\n\ttop:0;\n\tleft:0;\n\tbackground:#000;\n\topacity:0;\n\tz-index:-5;\n}\n<\/style>\n<p><\/p>\n<h4>\u672c\u30b5\u30f3\u30d7\u30eb\u8868\u793a\u7528HTML<\/h4>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n  &lt;input type=\"radio\" id=\"r1\" name=\"gal\"&gt;\r\n  &lt;input type=\"radio\" id=\"r2\" name=\"gal\"&gt;\r\n  &lt;input type=\"radio\" id=\"r3\" name=\"gal\"&gt;\r\n  &lt;input type=\"radio\" id=\"r4\" name=\"gal\"&gt;\r\n  &lt;input type=\"radio\" id=\"r5\" name=\"gal\"&gt;\r\n  &lt;input type=\"radio\" id=\"r6\" name=\"gal\"&gt;\r\n  &lt;input type=\"radio\" id=\"r7\" name=\"gal\"&gt;\r\n  &lt;div id=\"thumbs\"&gt;\r\n    &lt;label for=\"r1\"&gt;&lt;img src=\"wp-images\/s1.jpg\"&gt;&lt;\/label&gt;\r\n    &lt;label for=\"r2\"&gt;&lt;img src=\"wp-images\/s2.jpg\"&gt;&lt;\/label&gt;\r\n    &lt;label for=\"r3\"&gt;&lt;img src=\"wp-images\/s3.jpg\"&gt;&lt;\/label&gt;\r\n    &lt;label for=\"r4\"&gt;&lt;img src=\"wp-images\/s4.jpg\"&gt;&lt;\/label&gt;\r\n    &lt;label for=\"r5\"&gt;&lt;img src=\"wp-images\/s5.jpg\"&gt;&lt;\/label&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div id=\"frame\"&gt;\r\n  &lt;div id=\"photo1\"&gt;&lt;img src=\"wp-images\/1.jpg\"&gt;&lt;span class=\"title\"&gt;1\/5\u3000\u3000\u3000\u671d\u713c\u3051\u306e\u713c\u5cb3&lt;\/span&gt;&lt;\/div&gt;\r\n  &lt;div id=\"photo2\"&gt;&lt;img src=\"wp-images\/2.jpg\"&gt;&lt;span class=\"title\"&gt;2\/5\u3000\u3000\u3000\u91dd\u30ce\u6728\u5cb3\u3001\u30b9\u30d0\u30ea\u5cb3\u3092\u80cc\u306b\u5ca9\u5c0f\u5c4b\u6ca2\u5cb3\u3078\u306e\u767b\u308a&lt;\/span&gt;&lt;\/div&gt;\r\n  &lt;div id=\"photo3\"&gt;&lt;img src=\"wp-images\/3.jpg\"&gt;&lt;span class=\"title\"&gt;3\/5\u3000\u3000\u3000\u5263\u5cb3\u3092\u771f\u8fd1\u306b\u671b\u3080&lt;\/span&gt;&lt;\/div&gt;\r\n  &lt;div id=\"photo4\"&gt;&lt;img src=\"wp-images\/4.jpg\"&gt;&lt;span class=\"title\"&gt;4\/5\u3000\u3000\u3000\u9e7f\u5cf6\u69cd\u30f6\u5cb3\u3001\u5f8c\u7acb\u5c71\u9023\u5cf0&lt;\/span&gt;&lt;\/div&gt;\r\n  &lt;div id=\"photo5\"&gt;&lt;img src=\"wp-images\/5.jpg\"&gt;&lt;span class=\"title\"&gt;5\/5\u3000\u3000\u3000\u5ca9\u5c0f\u5c4b\u6ca2\u3001\u9cf4\u6ca2\u5cb3\u3092\u80cc\u306b\u5cb3\u723a\u30f6\u5cb3\u3078\u306e\u767b\u308a&lt;\/span&gt;&lt;\/div&gt;\r\n  &lt;div id=\"close_btn\"&gt;&lt;label for=\"r6\"&gt;? \u9589\u3058\u308b&lt;\/label&gt;&lt;\/div&gt;  &lt;\/div&gt;\r\n  &lt;label for=\"r7\"&gt;&lt;div id=\"darkscreen\"&gt;&lt;\/div&gt;&lt;\/label&gt;\r\n<\/pre>\n<h4>HTML\u306e\u6982\u8981\u8aac\u660e<\/h4>\n<p>\n\u30fb\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3 r1 &#8211; r5 \u306f\u8868\u793a\u5199\u771f\u7528\u3001r6 \u306f\u9589\u3058\u308b\u30dc\u30bf\u30f3\u7528\u3001r7 \u306f\u30c0\u30fc\u30af\u30b9\u30af\u30ea\u30fc\u30f3\u7528\u306b\u305d\u308c\u305e\u308c\u5272\u308a\u4ed8\u3051\u308b<br \/>\n\u30fbr6\u3001r7\u306f\u3001\u5199\u771f\u306e\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306b\u306f\u95a2\u9023\u4ed8\u3051\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u3053\u308c\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u5143\u306e\u72b6\u614b\u306b\u623b\u308b\u3002<br \/>\n\u3000\uff08\u62e1\u5927\u5199\u771f\u304c\u6d88\u3048\u3001\u30b5\u30e0\u30cd\u30a4\u30eb\u8868\u793a\u753b\u9762\u306b\u623b\u308b\uff09<br \/>\n\u30fb\u5199\u771f\u306f\u3001#frame\u306b\u5168\u90e8\u91cd\u306d\u3066\u914d\u7f6e\u3057\u3066\u304a\u304d\u3001\u30b5\u30e0\u30cd\u30a4\u30eb\u30af\u30ea\u30c3\u30af\u3067\u8a72\u5f53\u3059\u308b\u5199\u771f\u3092css transition \u3067\u30d5\u30a7\u30a4\u30c9\u30fb\u30a4\u30f3\u3055\u305b\u308b\u3002<\/p>\n<h4>\u672c\u5199\u771f\u8868\u793a\u7528CSS<\/h4>\n<pre>\r\n\/*\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3092\u975e\u8868\u793a\u306b*\/\r\n#r1, #r2, #r3, #r4, #r5,#r6,#r7 {\r\n\tdisplay: none;\r\n}\r\n\/*\u5168\u30b5\u30e0\u30cd\u30a4\u30eb\u306e\u30b3\u30f3\u30c6\u30ca\u30fc*\/\r\n#thumbs {\r\n\tposition: relative;\r\n\twidth: 630px;\r\n\tleft: 20px;\r\n\tmargin:0 auto;\r\n}\r\n\/*\u30b5\u30e0\u30cd\u30a4\u30eb\u306e\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc\u3067\u30dd\u30a4\u30f3\u30bf\u30fc\u3092\u624b\u306e\u3072\u3089*\/\r\n#thumbs label img {\r\n\tcursor: pointer;\r\n}\r\n\/*\u8868\u793a\u5199\u771f\u306e\u521d\u671f\u914d\u7f6e\uff08\u5168\u90e8\u900f\u660e\u306b\uff09\u3068transition\u8a2d\u5b9a*\/\r\n#photo1, #photo2, #photo3, #photo4, #photo5 {\r\n\tposition: absolute;\r\n\ttop:0;\r\n\tmargin:5px 5px 0 5px;\r\n\topacity: 0;\r\n\t-webkit-transition: opacity 1s ease;\r\n\t-moz-transition: opacity 1s ease;\r\n\t-o-transition: opacity 1s ease;\r\n\ttransition: opacity 1s ease;\r\n}\r\n\/* \u30b5\u30e0\u30cd\u30a4\u30eb\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3089#frame \u3092\u8868\u793a *\/\r\n#r1:checked ~ #frame,#r2:checked ~ #frame,#r3:checked ~ #frame,#r4:checked ~ #frame,#r5:checked ~ #frame {\r\n\topacity:1;\r\n\tz-index:95;\r\n}\r\n\/*\u30c1\u30a7\u30c3\u30af\u3055\u308c\u305f\u30b5\u30e0\u30cd\u30a4\u30eb\u306b\u76f8\u5f53\u3059\u308b\u5199\u771f\u3060\u3051\u3092\u8868\u793a*\/\r\n#r1:checked ~ #frame #photo1, #r2:checked ~ #frame #photo2, #r3:checked ~ #frame #photo3, #r4:checked ~ #frame #photo4, #r5:checked ~ #frame #photo5 {\r\n\topacity: 1;\r\n\tz-index:100;\r\n}\r\n\/* \u30b5\u30e0\u30cd\u30a4\u30eb\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3089#darkscreen \u3092\u8868\u793a *\/\r\n#r1:checked ~ label #darkscreen,#r2:checked ~ label #darkscreen,#r3:checked ~ label #darkscreen,#r4:checked ~ label #darkscreen,#r5:checked ~ label #darkscreen {\r\n\topacity:0.6;\r\n\tz-index:90;\r\n}\r\n\/* #frame *\/\r\n#frame {\r\n\tposition:fixed !important;\r\n\tposition:absolute;\r\n\tbackground:#fff;\r\n\twidth:610px;\r\n\theight:370px;\r\n\tleft:50%;\r\n\ttop:50%;\r\n\tmargin-left:-305px;\r\n\tmargin-top:-170px;\r\n\topacity:0;\r\n\tz-index:-11;\r\n}\r\n\/* \u5199\u771f\u306e\u4e0b\u306b\u8868\u793a\u3059\u308b\u30bf\u30a4\u30c8\u30eb *\/\r\n.title {\r\n\tposition:absolute;\r\n\tleft:10px;\r\n\ttop:345px;\r\n\tfont-size:12px;\r\n}\r\n\/* \u53f3\u4e0b\u306b\u8868\u793a\u3059\u308b\u9589\u3058\u308b\u30dc\u30bf\u30f3 *\/\r\n#close_btn label {\r\n\tposition:absolute;\r\n\tleft:540px;\r\n\ttop:350px;\r\n\tfont-size:14px;\r\n\tfont-weight:bold;\r\n\tcursor:pointer;\r\n}\r\n\/*\u5199\u771f\u8868\u793a\u6642\u306e\u753b\u9762\u906e\u853d\u30b9\u30af\u30ea\u30fc\u30f3*\/\r\n#darkscreen {\r\n\tposition:fixed !important;\r\n\tposition:absolute;\r\n\twidth:100%;\r\n\theight:100%;\r\n\ttop:0;\r\n\tleft:0;\r\n\tbackground:#000;\r\n\topacity:0;\r\n\tz-index:-5;\r\n}\r\n<\/pre>\n<h4>CSS\u306e\u30dd\u30a4\u30f3\u30c8\u8aac\u660e<\/h4>\n<p>\u30fb\u30b5\u30e0\u30cd\u30a4\u30eb\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3089\u3001#frame \u3092\u753b\u9762\u4e2d\u592e\u306b\u8868\u793a\u3055\u305b\u3001\u305d\u306e\u4e2d\u306b\u8a72\u5f53\u3059\u308b\u756a\u53f7\u306e\u5199\u771f\u3092\u8868\u793a\u3055\u305b\u308b\u3002<br \/>\n\u30fb\u62e1\u5927\u5199\u771f\u8868\u793a\u6642\u306e\u91cd\u306d\u9806\u306f\u3001\u4e0b\u304b\u3089\u3001#darkscreen -> #frame -> photo\u3000\u3068\u3059\u308b\u3002<br \/>\n\u30fb#frame\u306e\u5927\u304d\u3055\u3084\u3001\u95a2\u9023\u3059\u308b\u4f4d\u7f6e\u30c7\u30fc\u30bf\u306a\u3069\u306f\u3001\u62e1\u5927\u5199\u771f\u306e\u30b5\u30a4\u30ba\u306b\u5408\u308f\u305b\u3066\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u8868\u793a\u5199\u771f\u306e\u5927\u304d\u3055\u306b\u5fdc\u3058\u3066\u66ff\u3048\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<div class=\"ninja_onebutton\">\n<script type=\"text\/javascript\">\n\/\/<![CDATA[\n(function(d){\nif(typeof(window.NINJA_CO_JP_ONETAG_BUTTON_63425606c23ff308dc3d676e4f432981)=='undefined'){\n    document.write(\"<sc\"+\"ript type='text\\\/javascript' src='http:\\\/\\\/omt.shinobi.jp\\\/b\\\/63425606c23ff308dc3d676e4f432981'><\\\/sc\"+\"ript>\");\n}else{\n    window.NINJA_CO_JP_ONETAG_BUTTON_63425606c23ff308dc3d676e4f432981.ONETAGButton_Load();}\n})(document);\n\/\/]]>\n<\/script><span class=\"ninja_onebutton_hidden\" style=\"display:none;\"><?php the_permalink(); ?><\/span><span style=\"display:none;\" class=\"ninja_onebutton_hidden\"><?php the_title(); ?><\/span>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7686\u69d8\u304a\u306a\u3058\u307f\u306eLightBox\uff08\u753b\u9762\u306f\u305d\u306e\u307e\u307e\u3067\u3001\u753b\u9762\u4e2d\u592e\u306b\u5927\u304d\u3044\u30a4\u30e1\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u306e\u306b\u4f7f\u7528\u3055\u308c\u308bJavaScript\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\uff09\u30bf\u30a4\u30d7\u306e\u30d5\u30a9\u30c8\u30ae\u30e3\u30e9\u30ea\u30fc\u3067\u3042\u308b\u3002 1\/5\u3000\u3000\u3000\u671d\u713c\u3051\u306e\u91dd\u306e\u6728\u5cb3 2\/5\u3000\u3000\u3000\u91dd\u30ce\u6728\u5cb3 &hellip; <a class=\"more-link\" href=\"https:\/\/css.programming.jp\/?p=177\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-177","post","type-post","status-publish","format-standard","hentry","category-lightbox"],"_links":{"self":[{"href":"https:\/\/css.programming.jp\/index.php?rest_route=\/wp\/v2\/posts\/177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/css.programming.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css.programming.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css.programming.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/css.programming.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=177"}],"version-history":[{"count":42,"href":"https:\/\/css.programming.jp\/index.php?rest_route=\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":817,"href":"https:\/\/css.programming.jp\/index.php?rest_route=\/wp\/v2\/posts\/177\/revisions\/817"}],"wp:attachment":[{"href":"https:\/\/css.programming.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css.programming.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css.programming.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}