Tutorials4u.net Forum

Full Version: Change properties of dojox.image.Lightbox widget
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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"/>
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...
Reference URL's