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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    One popup window for many images to use, no toolbars, please help. Thanks

    Hi javascript guru's

    Please help with this one, I've been battling all day trying different scripts but none of them seem to work.
    I don't want to have to make hundred of htm pages for all the different images, I just want to use ONE pop up window and let all my images use that, all the images are the same size and they all link from seperate thumbnail images. (Small thumbnail, if interested click that to see the larger image).
    I'd like the pop up window to go centre on the screen if possible and I'd like it to just be a window, no toolbars.
    I was given a one script that I thought should work but I can't get it to, I don't know what I am doing wrong.

    <a href="javascript:thumbNailer("picture.gif");">click click</A>

    <script><!--
    function thumbNailer(pic) {
    var newWin = window.open('standardpage.htm','picwindow','addrbar=0,toolbar=0,
    location=0,directories=0,status=1,menubar=0,scrollbars=0,resizeable=0,width=550,height=425');
    newWin.document.images['thePic'].src = pic;
    }
    //--></script>

    inside of your standard picture file, you have an empty of invisible picture. this changes the source of that picture to whatever image you pass.

    I am afraid you may have to explain in very simple terms as I am not very good at (thinking)

    Thanks very much in advance.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi gin,

    Well I see a couple of things that might make it work


    1) <a href="java script:
    It should be
    <a href="javascript:
    One word

    2) The fundtion your useing doesn't look right to me so heres another function that you can use.


    ------------



    <script language="javascript">

    function picture(pic){
    var no="addrbar=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizeable=0,"
    no+="width=550,height=425"

    var mywin=window.open("","def",no)

    mywin.document.write("<center><img src='"+pic+"'>")
    mywin.document.write("<BR><BR><BR>")
    mywin.document.write("<input type='button' value=' Close Window ' onclick='javascript:window.close()'>")

    }
    </script>

    </head>
    <body>

    <a href="javascript:icture('ImageSRC')"> Click here</a>




    Hope this helped

    HappyScripting
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi A*C

    Thanks for the script, however I still can't get it to work. I get an error line 1 character 1 object expected.

    <script language="javascript">

    function picture(pic){
    var no=" addrbar=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizeable=0,"no+="widt h=720,height=576"

    var mywin=window.open("","def",no)

    mywin.document.write("<center><img src='"+pic+"'>")
    mywin.document.write("<BR><BR><BR>")
    mywin.document.write("<input type='button' value=' Close Window ' onclick='javascript:window.close()'>")

    }
    </script>
    </head>

    <body>

    <tr><td><p><a href="javascripticture('pic1.bmp')"><img src="tn_pic1.jpg" width="80" height="64"></a></p></td></tr>

    I am linking from a thumbnail image, will this effect the code?
    Although I did try with you click here link as well and I received the same error.

    Hope you can see what I am doing wrong.

    The javascript is all one word in all cases but for some reason in here it seperates it out.

    Thanks

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    okay well i see somthing that might be causing the error

    --------
    how it is now
    ---------

    var no="addrbar=0,toolbar=0,location=0,directories=0,statu
    s=1,menubar=0,scrollbars=0,resizeable=0,"no+="width=720,height=576"

    ----------
    should be, Each no+= has to be on there own line
    ----------
    var no=" addrbar=0,toolbar=0,location=0,directories=0,"
    no+="status=1,menubar=0,scrollbars=0,resizeable=0,"
    no+="width=720,height=576"


    Linking with an image isn't a problem at all. Its quite neet actualy
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #5
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi there A*C

    Thanks a lot for responding again.. I am going to check it now and see if it works. I will post back the result..


    Thanks a mill.. You are a *star*

  • #6
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    A*C

    What can I say.... YOU ARE THE KING... BRILLIANT.. !!

    IT WORKS, YOU HAVE SAVED MY LIFE....

    HOURS AND HOURS OF FRUSTRATION FIXED..

    I can't thank you enough.

    Have a great day... You really are a star.. *****

    Thanks

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It was my pleasure Gina
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog


  •  

    Posting Permissions

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