{"id":553,"date":"2017-03-22T14:20:10","date_gmt":"2017-03-22T05:20:10","guid":{"rendered":"http:\/\/www.takaya-com.jp\/archives\/?p=553"},"modified":"2017-03-22T14:20:10","modified_gmt":"2017-03-22T05:20:10","slug":"slideshow-photo_list","status":"publish","type":"post","link":"https:\/\/takaya-com.jp\/archives\/2017\/03\/slideshow-photo_list\/","title":{"rendered":"jQuery\u3092\u4f7f\u3063\u305f\u753b\u50cf\u4e00\u89a7\u306e\u30b9\u30e9\u30a4\u30c9\u30b7\u30e7\u30fc"},"content":{"rendered":"<p><!-- \u672c\u6587 --><\/p>\n<p>\u30b9\u30e9\u30a4\u30c9\u30b7\u30e7\u30fc\u98a8\u306b\u3001\u753b\u50cf\u304c\u9806\u756a\u306b\u8868\u793a\u3055\u308c\u308bJavaScript\u3067\u3059\u3002<br \/>\njQuery\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5de6\u5074\u306e\u753b\u50cf\u4e00\u89a7\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u8868\u793a\u3059\u308b\u753b\u50cf\u3092\u9078\u3076\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><!--more--><br \/>\n\u2193\u4ee5\u4e0b\u304c\u5b9f\u969b\u306e\u30bd\u30fc\u30b9\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n<p>\u25bcJavaScript<\/p>\n<pre class=\"lang:js decode:true \" title=\"JavaScript\" >\r\n<script src=\"http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.9.0\/jquery.min.js\"><\/script>        \r\n<script type=\"text\/javascript\">\r\n    $(function(){\r\n\t\r\n\t   var Active \t= 0;\r\n\t   var TimerId\t= 0;\r\n\t\r\n\t   photo_timer();\r\n\t\r\n\t$(\"#navi a\").click(function(){\r\n\t\tclearInterval(TimerId);\r\n\t\tActive = $(\"#navi a\").index(this);\r\n\t\tslide_animate();\r\n\t\tphoto_timer();\r\n\t\treturn false;\r\n\t});\r\n\t\r\n\t$(\"#main img\").mouseover(function(){\r\n\t\tclearInterval(TimerId);\r\n\t}).mouseout(function(){\r\n\t\tphoto_timer();\r\n\t});\r\n\t\r\n\tfunction photo_timer() {\r\n\t\tTimerId = setInterval(function(){\r\n\t\t\tActive++;\r\n\t\t\tif($(\"#navi a\").length <= Active) {\r\n\t\t\t\tActive = 0;\r\n\t\t\t}\r\n\t\t\tslide_animate();\r\n\t\t},2000);\r\n\t}\r\n\t\r\n\tfunction slide_animate() {\r\n\t\t$(\"#main .photo_list\").stop();\r\n\t\t$(\"#main .photo_list\").animate({\r\n\t\t\tmarginLeft : Active * -650 + \"px\"\r\n\t\t},\"slow\");\r\n\t}\r\n\t\r\n});\r\n<\/script>\r\n<\/pre>\n<p>\u25bcCSS<\/p>\n<pre class=\"lang:css decode:true \" title=\"CSS\" >\r\n<style type=\"text\/css\">\r\n*{\r\n\t\r\n\tpadding:0;\r\n\tborder:0;\r\n}\r\nbody{\r\n\tbackground:#34495E;\r\n    margin: 0 auto;\r\n}\r\n#picture_main{\r\n\twidth:900px;\r\n\tmargin:20px auto;\r\n    \r\n}\r\n#navi{\r\n\twidth:150px;\r\n\tfloat:left;\r\n    \r\n}\r\n#navi ul{\r\n\theight:460px;\r\n}\r\n#navi li{\r\n\tlist-style-type:none;\r\n\twidth:150px;\r\n\tfloat:left;\r\n}\r\n#navi li img{\r\n\tborder:5px solid white;\r\n}\r\n#navi{\r\n\toverflow:hidden;\r\n}\r\n#navi .page_navi{\r\n\twidth:150px;\r\n}\r\n#navi .page_navi .page{\r\n\twidth:150px;\r\n\tfloat:left;\r\n}\r\n#navi p{\r\n\tclear:both;\r\n\twidth:150px;\r\n\ttext-align:center;\r\n}\r\n#navi p img{\r\n\tcursor:pointer;\r\n}\r\n#main{\r\n\twidth:650px;\r\n\tfloat:right;\r\n\toverflow:hidden;\r\n}\r\n#main img{\r\n\tfloat:left;\r\n\tborder:5px solid white;\r\n}\r\n\r\n#main .photo_list {\r\n\twidth:2600px;\r\n}\r\n\r\n<\/style>\r\n<\/pre>\n<p>\u25bcHTML<\/p>\n<pre class=\"lang:xhtml decode:true \" title=\"XHTML\" >\r\n<div id=\"picture_main\">\r\n\t<div id=\"navi\">\r\n\t\u3000<div class=\"page_navi\">\r\n\t\u3000\u3000<div  class=\"page\">\r\n\t\t<ul>\r\n\t\t\u3000<li><a href=\"img\/img0.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"img\/img0.jpg\" alt=\"photo1\" width=\"140\" height=\"105\" ><\/a><\/li>\r\n\t\t\u3000<li><a href=\"img\/img1.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"img\/img1.jpg\" alt=\"photo2\" width=\"140\" height=\"105\" ><\/a><\/li>\r\n\t\t\u3000<li><a href=\"img\/img2.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"img\/img2.jpg\" alt=\"photo3\" width=\"140\" height=\"105\" ><\/a><\/li>\r\n\t\t\u3000<li><a href=\"img\/img3.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"img\/img3.jpg\" alt=\"photo4\" width=\"140\" height=\"105\" ><\/a><\/li>\r\n\t\t<\/ul>\r\n\t\u3000\u3000<\/div>\r\n\t\u3000<\/div>\r\n\t<\/div>\r\n\u3000\u3000<div id=\"main\">\r\n\u3000\u3000\u3000\u3000<div class=\"photo_list\">\r\n\t\t<img decoding=\"async\" loading=\"lazy\" src=\"img\/img0.jpg\" alt=\"photo1\" width=\"640\" height=\"427\">\r\n\t\t<img decoding=\"async\" loading=\"lazy\" src=\"img\/img1.jpg\" alt=\"photo1\" width=\"640\" height=\"427\">\r\n\t\t<img decoding=\"async\" loading=\"lazy\" src=\"img\/img2.jpg\" alt=\"photo1\" width=\"640\" height=\"427\">\r\n\t\t<img decoding=\"async\" loading=\"lazy\" src=\"img\/img3.jpg\" alt=\"photo1\" width=\"640\" height=\"427\">\r\n\u3000\u3000\u3000\u3000<\/div>\r\n\u3000\u3000<\/div>\r\n<\/div>\r\n<\/pre>\n<p><a href=\"http:\/\/www.takaya-com.jp\/archives\/demo\/slideshow\/\" target=\"_blank\">\u30c7\u30e2\u30da\u30fc\u30b8\u306f\u3001\u3053\u3061\u3089<\/a><\/p>\n<p><\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30b9\u30e9\u30a4\u30c9\u30b7\u30e7\u30fc\u98a8\u306b\u3001\u753b\u50cf\u304c\u9806\u756a\u306b\u8868\u793a\u3055\u308c\u308bJavaScript\u3067\u3059\u3002 jQuery\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002 \u5de6\u5074\u306e\u753b\u50cf\u4e00\u89a7\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u8868\u793a\u3059\u308b\u753b\u50cf\u3092\u9078\u3076\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/posts\/553"}],"collection":[{"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/comments?post=553"}],"version-history":[{"count":2,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/posts\/553\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/posts\/553\/revisions\/555"}],"wp:attachment":[{"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/media?parent=553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/categories?post=553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/tags?post=553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}