Click to enlarge issues

E

Eraserhead

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.htm"
winpops=window.open(popurl,"","width=420,height=440,")
}


</script>

<a href="javascript:eek:penpopup()">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
 
E

eifs

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

function openpopup(popupurl)
{
winpops=window.open(popurl,"","width=420,height=440,")
}

and call it that way?


Eifion
 
H

Hywel Jenkins

eraserhead99 said:
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.htm"
winpops=window.open(popurl,"","width=420,height=440,")
}
</script>

<a href="javascript:eek:penpopup()">Image here</a>


All is good, except I have like 15 items

So how many is that? 14? 16?

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.

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

Then change your function to
function openpopup()
{

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

You this code to get the value of the NVP:
http://hyweljenkins.co.uk/programming/js/getnvp.php
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top