استایل:
کد:
<style type="text/css">a.shahinshahr{position:relative;display: block;overflow:hidden;cursor: pointer;width: 650px; /* set width of image container */height: 434px; /* set height of image container */}a.shahinshahr img{position:absolute;left:0;top:0;width: 100%;height: 100%;-moz-transition: all 0.5s ease; /* enable transition */-webkit-transition: all 0.5s ease;-o-transition: all 0.5s ease;-ms-transition: all 0.5s ease;transition: all 0.5s ease;z-index: 2;clip: rect(0,650px,434px,0); /* clip values should be rect(0,image_width,image_height,0) */}a.shahinshahr img:nth-of-type(2){ /* hide "after" image beneath "before" so it's initially out of view */z-index: 1;}a.shahinshahr:hover img:nth-of-type(1){ /* clip "before" image to reveal "after" */clip: rect(0,0,434px,0); /* clip values should be rect(0,0,image_height,0) */opacity: 0;}a.shahinshahr.alt{width: 300px; /* set width of image container */height: 354px; /* set height of image container */}a.shahinshahr.alt img{clip: rect(0,300px,354px,0); /* clip values should be rect(0,image_width,image_height,0) */}a.shahinshahr.alt:hover img:nth-of-type(1){clip: rect(0,0,354px,0); /* clip values should be rect(0,0,image_height,0) */}</style>body:
کد:
<a class="shahinshahr alt"> <img src="http://s1.picofile.com/file/7551296876/before2f.jpg" alt=""> <img src="http://s3.picofile.com/file/7551297525/after2g.jpg" alt=""></a><a href="http://www.shahinshahr.rozblog.com">بهترین وبلاگ تفریحی ایرانیان</a>