CSS Popup Image Viewer

หลังจากที่พยายามผสมผสาน ระหว่าง สคริปที่แล้ว
เวลาเอาเม้าส์ไปวาง จะขยายรูปให้เท่ากับขนาดรูปเดิม
ตัวอย่าง ให้เอาเม้าส์ไปวางบนรูปดูครับ

มาเริ่มที่สคริปกันเลย
<style type=”text/css”>

/*Credits: Dynamic Drive CSS Library */
/*URL:
http://www.dynamicdrive.com/style/ */

.thumbnail{
position: relative;
z-index: 0;
}

.thumbnail:hover{
background-color: transparent;
z-index: 50;
}

.thumbnail span{ /*CSS for enlarged image*/
position: absolute;
background-color: lightyellow;
padding: 5px;
left: -1000px;
border: 1px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}

.thumbnail span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}

.thumbnail:hover span{ /*CSS for enlarged image on hover*/
visibility: visible;
top: 0;
left: 60px; /*position where enlarged image should offset horizontally */

}

</style>
แล้วตอนเรียกใช้

<a class=”thumbnail” href=”#thumb”><img src=”show_image.php?filename=products_image/<? echo”$r_batt[picture]“; ?>&width=200&height=150″ border=”0″ /><span><img src=”show_image.php?filename=products_image/<? echo”$r_batt[picture]“; ?>” /><br />
   <? echo”$r_batt[oska_model]“; ?></span></a>

แค่นี้เองครับ แล้วสามารถปรับแต่ง ที่ CSS ได้ด้วย

Credit : http://www.dynamicdrive.com/style/csslibrary/item/css-popup-image-viewer/ 
 

 

Tags:

5 Responses to “CSS Popup Image Viewer”

  1. Dexteri@n Says:

    เจ๋งๆ งับ หามาลงเยอะๆนะ จะได้มาค้นที่นี่ที่เดียว ฮ่าฮ่า

  2. yozzinho Says:

    555+

    เมิงด้วย หามาเยอะๆ

  3. Anonymous Says:

    เขียนเองป่ะ

  4. Anonymous Says:

    เขียนให้เยอะๆ กว่านีอีกนะ อิอิ

  5. yozzinho Says:

    เขียนเองครับ แต่พวก สคริป เอาจากเว็บนอกมา มาดัดแปลงให้ใช้กะของผมได้อีกทีครับ

    สรุปว่า เอาของคนอื่นมาใช้นั่นเอง อิอิ

    สังเกตุ ที่ผมให้เครดิตนะครับ

Leave a Reply