Tutorials4u.net Forum
Change properties of dojox.image.Lightbox widget - Printable Version

+- Tutorials4u.net Forum (http://www.tutorials4u.net/forum)
+-- Forum: Discussion Forum (/forumdisplay.php?fid=1)
+--- Forum: Dojo (/forumdisplay.php?fid=8)
+--- Thread: Change properties of dojox.image.Lightbox widget (/showthread.php?tid=73)


Change properties of dojox.image.Lightbox widget - vijay - 02-02-2011 10:19 AM

I have one big picture on page and couple of thumbnails below it. I attached Lightbox to big picture like this:

<a id="productMainImageLB" dojoType="dojox.image.Lightbox" href="pathToImage">
<img id="productMainImage" src="pathToImage" width="300"/>
</a>
There is js function which replaces big picture with one from thumbnail when its clicked that looks like this:

function changeThumbNail(angleImgId,imgsrc){
if (currentAngleImgId != "") { document.getElementById(currentAngleImgId).className ='off';
}
currentAngleImgId = angleImgId;
document.getElementById(angleImgId).className ='on'; document.getElementById("productMainImage").src = imgsrc;
}

so i figured out that for my lightbox to work correctly i need to update href attribute on widget when picture inside is updated. I add following line to my function:

dojo.byId("productMainImageLB").setAttribute("href", imgsrc);
it seems to work(i see changed url on page when i use IE dev. toolbar) but when i click on it, it still show the same picture and not the actual one. Is there any need to update that widget somehow or refresh it? CouldnĀ“t find any help on this...