Hi All,
Recently, I discovered a interesting piece of javascript which offers
a nice way of magnifying pictures and other images :
http://www.c6software.com/Products/PopBox
I've made some minor changed (Verdana in stead of Arial, and an extra text box
at the bottom of the small picture) but some visitors tell me that the images
disappear after they have been clicked. Also, the bottom text box doesn't seem
to be aligned correctly in IE.
http://www.gsm-antennes.nl/kpn/index.html
The same page, but linked to the original script :
http://www.gsm-antennes.nl/kpn/index-org.html
Can anyone tell me what the problem is?
Regards,
Peter Hunt, Holland
Hello,
If u are still interested in solving that problem... it's a well known
problem with borders in IE. In IE border width is included in width of
element, so if you want the title to display properly you should
rewrite the code for divCapTrans var.
The solution is to wrap this div (without border) with another div
(without width and height but with border), so this:
var divCapTrans = document.createElement("div");
divCapTrans.id = "popBoxDivCapTrans" + z;
divCapTrans.style.width = width - 2 + "px";
divCapTrans.style.height = "20px";
divCapTrans.style.borderStyle = "solid";
divCapTrans.style.borderWidth = "1px";
divCapTrans.style.borderColor = "#999999";
divCapTrans.style.padding = "0px";
divCapTrans.style.margin = "0px";
divCapTrans.style.position = "absolute";
divCapTrans.style.left = left + "px";
divCapTrans.style.top = top - 1 + "px";
divCapTrans.style.backgroundColor = "#ffffdd";
divCapTrans.style.zIndex = z;
should be replaced with this:
var divCapTrans = document.createElement("div");
divCapTrans.style.width = (width - 2) + "px";
divCapTrans.style.height = "20px";
divCapTrans.style.margin = "0px";
divCapTrans.style.backgroundColor = "#ffffdd";
var pbCaptionBordered = document.createElement("div");
pbCaptionBordered.style.border = "solid 1px #999999";
pbCaptionBordered.style.zIndex = z;
pbCaptionBordered.style.position = "absolute";
pbCaptionBordered.style.left = left + "px";
pbCaptionBordered.style.top = top - 2 + "px";
pbCaptionBordered.style.padding = "0px";
pbCaptionBordered.id = "popBoxDivCapTrans" + z;
then you must add these elements in proper order so:
parentNode.appendChild(divCapTrans);
fnRemove.push(function(){divCapTrans.parentNode.removeChild
(divCapTrans);});
will be:
pbCaptionBordered.appendChild(divCapTrans);
parentNode.appendChild(pbCaptionBordered);
fnRemove.push(function(){pbCaptionBordered.parentNode.removeChild
(pbCaptionBordered);});
and change line which adds a caption:
AddCaptionText(divCapTrans, divCapText, pbCaption);
to this:
AddCaptionText(pbCaptionBordered, divCapText, pbCaption);
This clue does not solve the problem in 100% - in IE there is stil
some problem but I think that you should be able to tackle this alone.
Best regards,
Magda