Click to enlarge issues

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

    Click to enlarge issues

    I have a store that I'm building and I want to be able to click on a
    thumbnail and have a popup window open with the enlargement in it. I have
    this working right now using this.

    <script>

    function openpopup(){
    var popurl="myurl.h tm"
    winpops=window. open(popurl,"", "width=420,heig ht=440,")
    }


    </script>

    <a href="javascrip t:openpopup()"> Image here</a>


    All is good, except I have like 15 items on the page and need it to work
    with a different URL for each page. Not sure how to do this, with an array?
    Thanks in advance for your help.

    Jamie


  • eifs

    #2
    Re: Click to enlarge issues

    Can you not make the URL a parameter for your function, i.e.

    function openpopup(popup url)
    {
    winpops=window. open(popurl,"", "width=420,heig ht=440,")
    }

    and call it that way?


    Eifion

    Eraserhead wrote:[color=blue]
    > I have a store that I'm building and I want to be able to click on a
    > thumbnail and have a popup window open with the enlargement in it. I have
    > this working right now using this.
    >
    > <script>
    >
    > function openpopup(){
    > var popurl="myurl.h tm"
    > winpops=window. open(popurl,"", "width=420,heig ht=440,")
    > }
    >
    >
    > </script>
    >
    > <a href="javascrip t:openpopup()"> Image here</a>
    >
    >
    > All is good, except I have like 15 items on the page and need it to work
    > with a different URL for each page. Not sure how to do this, with an array?
    > Thanks in advance for your help.
    >
    > Jamie
    >
    >[/color]

    Comment

    • Hywel Jenkins

      #3
      Re: Click to enlarge issues

      In article <N8DTa.826531$c I2.117082@news. easynews.com>, eraserhead99
      @hotmail.com says...[color=blue]
      > I have a store that I'm building and I want to be able to click on a
      > thumbnail and have a popup window open with the enlargement in it. I have
      > this working right now using this.
      >
      > <script>
      >
      > function openpopup(){
      > var popurl="myurl.h tm"
      > winpops=window. open(popurl,"", "width=420,heig ht=440,")
      > }
      > </script>
      >
      > <a href="javascrip t:openpopup()"> Image here</a>
      >
      >
      > All is good, except I have like 15 items[/color]

      So how many is that? 14? 16?

      [color=blue]
      > on the page and need it to work
      > with a different URL for each page. Not sure how to do this, with an array?
      > Thanks in advance for your help.[/color]

      Use something like
      href="openpopup ('imagename.jpg ');" ...

      Then change your function to
      function openpopup()
      {

      var popurl="myurl.h tm?image=' + GetNVP(location .search,'image' );
      ...

      You this code to get the value of the NVP:





      --
      Hywel I do not each quiche


      Comment

      Working...