SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Popup Help

  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Popup Help

    Hi
    I dont know if any one can help me with thiss popup thingy
    I am making a website and have tried this script and it works fine on the desk top. I need to click on a picture and have the popup onen then.
    I cant seam to edit the html file to do this.
    ie pictures on the site are in same folder as well as the htm file . the picture is linked to the html file but no popup.
    Could anyone tell me how to write a html file that will pop the picture.
    Many Thanks
    Phil.
    (I am a novice at this and ..............well u know)

  2. #2
    code ninja hamstu's Avatar
    Join Date
    Nov 2002
    Location
    Montréal, Canada
    Posts
    375
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please give more information. What popup script are you using? And do you have a link to your page?

  3. #3
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi
    Many thanks For the reply....
    The test page is here http://eshopgirl.co.uk/Retro-Style-Tops.php

    At the moment it pops up as a new window ....jpg full size

    I wanted to use popup.htm
    <HTML>
    <HEAD>
    <TITLE>Fit the Pic Script</TITLE>
    <script language='javascript'>
    var arrTemp=self.location.href.split("?");
    var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
    var NS = (navigator.appName=="Netscape")?true:false;

    function FitPic() {
    iWidth = (NS)?window.innerWidth:document.body.clientWidth;
    iHeight = (NS)?window.innerHeight:document.body.clientHeight;
    iWidth = document.images[0].width - iWidth;
    iHeight = document.images[0].height - iHeight;
    window.resizeBy(iWidth, iHeight);
    self.focus();
    };
    </script>
    </HEAD>
    <BODY bgcolor="#000000" onload='FitPic();' topmargin="0"
    marginheight="0" leftmargin="0" marginwidth="0">
    <script language='javascript'>
    document.write( "<img src='" + picUrl + "' border=0>" );
    </script>
    </BODY>
    </HTML>

    but i cant seem to make a html file that triggers the popup automaticaly when it is linked to the picture, without clicking in a open image link.

    IE just want to click on picture an up it pops

    Any help would be apprecated
    Many thanks again
    Phil.

  4. #4
    SitePoint Member
    Join Date
    Feb 2007
    Location
    Brooklyn, NY
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your html link you need something like:

    //call the page with the pop-up script and include the image in the querystring

    <a href="img.jpg" onclick="window.open("pathtopopup.htm?" + imgFile, "newWin","height=500,width=500,top=25,left=50,status=0,resizable=yes"); return false;>

    //your image file for link
    <img src="yadayada.jpg" />

    /
    </a>

    Hope that helps.

  5. #5
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi
    Really cant get this I still cant do it (


    Looks like this......


    <HTML>
    <HEAD>
    <TITLE>The Image Gallery</TITLE>
    <script language="Javascript">
    function PopupPic(sPicURL) {
    window.open( "popup.htm?"+sPicURL, "",
    "resizable=1,HEIGHT=200,WIDTH=200");
    }
    </script>
    </HEAD>
    <BODY bgcolor="#FFFFFF">
    <a href="img.jpg" onclick="window.open("pathtopopup.htm?" + imgFile, "newWin","height=500,width=500,top=25,left=50,status=0,resizable=yes"); return false;>

    //your image file for link
    <img src="esp012a_365x561.jpg" />

    /
    </a>



    </BODY>
    </HTML>


    The result........... http://eshopgirl.co.uk/Retro-Style-Tops.php


    Not the best of popups ha

    any more sugestions for a novice????

    Phil.


Bookmarks

Posting Permissions

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