Thursday, 22 October 2009

make a popup window for showing full image in Blogspot

in blog ,sometime you have to resize image for displaying in blog .But what happen if your reader want to see full picture of your image instead of thumbnal or resized ones ? To show full image in post ,you can make a pop-up window ,when reader move mouse's cursor over the picture , a pop-up with full image will be appeared . In Fandung blog ,I found this code . Thanks Fandung for this tip .
Tạo cửa sổ popup khi rê chuột vào ảnhLive demo here

To do this ,follow some simple steps bellow :
login to your blogspot account . Go to Layout ,edit HTML ,add this code bellow after </head>

<style type='text/css'>

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

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

.img-thumbnail span{
position: absolute;
background-color: #ffffff;
padding: 5px;
left: -1000px;
border: 1px solid #000;
visibility: hidden;
color: black;
text-decoration: none;
}

.img-thumbnail span img{
border-width: 0;
padding: 2px;
}

.img-thumbnail:hover span{
visibility: visible;
top: -100px;
left:100px; /*position where enlarged image should offset horizontally */
}

</style>

two red line in the code above is the position of your pop-up . You can change this for your blog .

Add this code for each image you want to add pop-up window . The img tag with height and width attribute is used for thumbnail ,the followed img tag is which showed in pop-up window .

<a class="img-thumbnail" href="#">
<img src="url for image 1" border="0" height="98" width="130"/>
<span>
<img src="url for image 1"/>
</span>
</a>

check this tip for now and give me comment if you meet any error .
Thanks Fandung again for this tip .

huy signature

7 comments:

  1. Hi Fandung,always looking forward to your new posts. and this tip really is a smart trick.

    yet looking for another great template from you. Good work

    ReplyDelete
  2. Don't you mean "add this code just BEFORE "/HEAD"????

    ReplyDelete
  3. Thank you. It works perfeclty now.

    ReplyDelete
  4. @Nahai : I checked your blog ,I see you inserted 3 pictures but it's only show 2 pics ,So the blank bellow 2 pictures you mentioned maybe the space for picture 3 . Check your pictures again .
    By the way ,I see many <br/> tags added . Could you delete some of them and see the result ?

    ReplyDelete
  5. Hi nhamngahanh,

    How to make popup for feedburner subscription? just like> http://www.mailchimp.com/kb/article/what-does-enable-evil-popup-mode-mean/

    ReplyDelete
  6. @Pmodels : here is the post for you : http://simplexdesign.blogspot.com/2010/02/make-pop-up-contact-form-for-blogger.html

    follow this post but replace Google docs code with Feedburner code . I hope this helpful .

    ReplyDelete