Hi there.
I'm using the excellent lightbox script to show some images. The recommended syntax is:
<a href=" rel="lightbox">
I have the code working with a static image, but I have a select box with multiple values, and I want the URL above to be based on a user's selection., but I also need to somehow add the "rel" tag.
The code below works fine, but the Lightbox script won't run as the "rel" tag is missing. If I do this:
<a href="javascript:a(1)" rel="lightbox">
the script does not access the image and stalls. I don't know what I need to do. Any ideas?
I'm using the excellent lightbox script to show some images. The recommended syntax is:
<a href=" rel="lightbox">
I have the code working with a static image, but I have a select box with multiple values, and I want the URL above to be based on a user's selection., but I also need to somehow add the "rel" tag.
The code below works fine, but the Lightbox script won't run as the "rel" tag is missing. If I do this:
<a href="javascript:a(1)" rel="lightbox">
the script does not access the image and stalls. I don't know what I need to do. Any ideas?
Code:
<script type="text/javascript">
var acc040rb = new Image().src = "images/basket/acc040-rb.jpg";
var acc040bo = new Image().src = "images/basket/acc040-bo.jpg";
var acc040by = new Image().src = "images/basket/acc040_by.jpg";
function setImage(imageSelect, myid) {
theImageIndex = imageSelect.options[imageSelect.selectedIndex].value;
if (document.images)
document.getElementById(myid).src = eval(theImageIndex);
}
function a(myid) {
location.href=document.getElementById(myid).src;
}
</head>
<body>
<div class="outer">
<select name='items1' class="select" onChange="setImage(this, 1)">
<option value="acc040rb">Red & Blue</option>
<option value="acc040bo">Blue & Orange</option>
<option value="acc040by">Blue & Yellow</option>
</select>
<a href="javascript:a(1)"><img src='images/basket/as10sh.jpg' border="0" class="multiple" id="1" ></a>
<div class='desc_multiple desc'>My product description<span class='price'>£14.50</span></div>
<div class='button'><a href="basket.php?Id=ASL203-BK&Description=My Products&Price=&Vat=14.5&PostageCode=0&UQty=1&Unit=Each">
<img src="images/btn_accs.gif" border="0" class="button_desc"></a></div>
</div>