<!DOCTYPE html> <html lang="ja-JP"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,user-scalable=yes,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.5"> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script> $(function(){ $("img:nth-last-of-type(1)").click(function(){ $("span").css("margin-right","-600px"); }); $("img:nth-last-of-type(2)").click(function(){ $("span").css("margin-right","-400px"); }); $("img:nth-last-of-type(3)").click(function(){ $("span").css("margin-right","-200px"); }); $("img:nth-last-of-type(4)").click(function(){ $("span").css("margin-right","0px"); }); $("img:nth-last-of-type(5)").click(function(){ $("span").css("margin-right","-800px"); }); }); </script> <style> img{ cursor:pointer; float:right; } div{ float:left; width:200px; height:200px; overflow:visible; overflow:hidden; } span{ float:right; display:block; width:1000px; margin-right:-800px; /*これらを記述するとアニメーションが加わります*/ /* -moz-transition-property:margin-right; -webkit-transition-property:margin-right; -o-transition-property:margin-right; -ms-transition-property:margin-right; -moz-transition-duration:500ms; -webkit-transition-duration:500ms; -o-transition-duration:500ms; -ms-transition-duration:500ms; -moz-transition-timing-function:ease-in-out; -webkit-transition-timing-function:ease-in-out; -o-transition-timing-function:ease-in-out; -ms-transition-timing-function:ease-in-out; */ } </style> </head> <body> <div> <span> <img src="img/image5.png"> <img src="img/image4.png"> <img src="img/image3.png"> <img src="img/image2.png"> <img src="img/image1.png"> </span> </div> </body> </html>