Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    popup window on image click

    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

  • #2
    Regular Coder
    Join Date
    Mar 2010
    Posts
    201
    Thanks
    79
    Thanked 5 Times in 5 Posts
    You could do something like this:
    Code:
    <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)
    }
    </script>
    
    <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.

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

  • #3
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks, works perfectly.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •