Help with multiple scripts on one page....

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ucsbgaucho

    Help with multiple scripts on one page....

    I have a series of images that, when I click on the thumbnails, I would like to open in a pop-up window fitting the exact size of the image. All the images are either 600x400 wide, or 400x600 tall.... So i created 2 javascript popups, popTall and popWide, so when you click on a wide thumbnail, it accesses popWide, and the tall thumbnails access popTall. The popWide script is first in my code, and it works fine, but the popTall doesnt work at all.... Can you help me with my script so that each one works?! Thanks! Here is the script I'm using in the "HEAD"....

    <head>

    <SCRIPT LANGUAGE="JavaS cript">
    function popWide(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL , '" + id + "', 'toolbar=0,scro llbars=0,locati on=0,statusbar= 0,men
    ubar=0,resizabl e=0,width=600,h eight=400,left = 376,top = 135');");
    }
    // End -->
    </script>

    <SCRIPT LANGUAGE="JavaS cript">
    function popTall(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL , '" + id + "', 'toolbar=0,scro llbars=0,locati on=0,statusbar= 1,men
    ubar=0,resizabl e=1,width=400,h eight=600,left = 376,top = 135');");
    }
    // End -->
    </script>

  • Richard Barnet

    #2
    Re: Help with multiple scripts on one page....

    "ucsbgaucho " <chris@chrisaus tin.us> wrote in message
    news:6d61205d0d 735d6675ae8e7e8 8820a3d@localho st.talkaboutpro gramming.com...[color=blue]
    > Can you help me with my script so that each one works?!
    > Thanks! Here is the script I'm using in the "HEAD"....
    >
    > function popWide(URL) {
    > day = new Date();
    > id = day.getTime();
    >[/color]
    ... <snip> ...[color=blue]
    >
    > function popTall(URL) {
    > day = new Date();
    > id = day.getTime();[/color]


    You're trying to reuse identical variable names on the same page.
    Doesn't work. Rename the second scripts variables to "day2" and "id2"
    or similar. Then it should work.

    -- Richard


    Comment

    Working...