An email came from one of my readers, about a way to add a popup window in the sidebar. She suggested that this must be like a Gadget to be added anywhere in the blog, especially on the sidebar. Her another preference was to link the popup so that it will open her another blog. These requirements looked quite interesting for me. Here is the code that I send to her last week. Hopes that this will work good for you too. Any trouble, please feel free to ask me.
How to add a popup window gadget in your blog
Login to your Blogger Account, Go to Dashboard, then click on Design. Now click on Add a Gadget and select “HTML/JavaScript”. Copy the below given code given in red colors and Save. The customization of the below script is given down to the code.
<script language="javascript">
var popupWindow = null;
function positionedPopup(url,winName,w,h,t,l,scroll){
settings =
'height='+h+',width='+w+',top='+t+',left='+l+',scrollbars='+scroll+',resizable'
popupWindow = window.open(url,winName,settings)
}
</script>
<p><a href=http://businessvartha.blogspot.com onclick="positionedPopup(this.href,'myWindow','500','300','100','200','yes');return false">My Favorite Blog</a></p><a href="http://lnk.co/popupgadget"/><span style="font-size: 80%">Grab this</span></a>
How to customize the code of Popup window:
Change http://businessvartha.blogspot.com to the URL of the link that you want to exhibit inside the popup window. You can exhibit a picture or another blog by giving that URL at this place.
Change My Favorite Blog to any text of your choice. This will be displayed on your blog in which any click will show a popup to linked URL.
*Please remember that this is a positioned popup.
More to Read: