View Full Version : popup window on image click

09-30-2011, 06:03 PM
I have a sitelock.com image on my website that when clicked on, shows info that my site is verfifed through them. However, when clicking on the image it opens up in a whole new window.
Pathetic sitelock.com will offer no support in getting this in a popup window.

I need some help please in getting this to open in a popup window that I can resize to any size I want and to only have the address bar showing up top, no toolbars or anything else.

My website is in joomla and I have a plugin called 'sourcerer' that will allow me to insert code anywhere i want.

Here is the code that sitelock.com gave me:

<a href="https://www.sitelock.com/verify.php?site=ecig-skins.com" target="_blank" ><img alt="website security" title="SiteLock" border="0" src="//shield.sitelock.com/shield/ecig-skins.com"/></a>

Any help is appreciated

09-30-2011, 06:39 PM
You could do something like this:

<script type="text/javascript">

function popup(pUrl, pName, pWidth, pHeight, pScroll)
LeftPosition = (screen.width) ? (screen.width-pWidth) / 2 : 0;
TopPosition = (screen.height)? (screen.height-pHeight) / 2 : 0;
settings = 'height='+pHeight+', width='+pWidth+', top='+TopPosition+', left='+LeftPosition+', scrollbars='+pScroll+', resizable';
win = window.open(pUrl, pName, settings)

<a href="http://www.google.nl" onclick="popup(this.href,'name','530','500','no'); return false">Google</a>

If you change onclick value pScroll to yes it displays a scrollbar in popup.
But if you write no like this example then it will be removed.
Hope this helps you out. :thumbsup:

Note: you should remove the target blank when using this code.

09-30-2011, 07:07 PM
thanks, works perfectly.