/    Sign up×
Community /Pin to ProfileBookmark

Problem with popupwindow displayed on InternetExplorer

Hi All,

i created one tooltippopup window which will show the products Discription with product image. It is working properly in Mozilla ,safari and firefox except Internet Explorer . In IE this popup window is becoming transparent to selectboxes. which is there in main window.Here is the javascript code i used

<script type=”text/javascript”>

writeDrag.handleId = “handle”;
writeDrag.writeId = “cntnt”;

// required arg’s: event, image path and file name (as this.href)
// important but optional arg’s: width of image, height of image
// other optional arg’s: txt, layer width, offx, offy
function wrapContent(e, img, pname, pdesc, w, h, txt, wd, offx, offy) {
var imgStr, cntnt, win, str, imgStr1;

imgStr = ‘<img src=”‘ + img + ‘”‘ + (w? ‘ width=”‘ + w + ‘”‘: “”) + (h? ‘ height=”‘ + h + ‘”‘: “”) + ‘>’;
//imgStr = ‘<img src=”‘ + img + ‘” >’;

imgStr1 ='<img src=”<%=contextPath%>/images/homeimages1/02_our_products8_034_03.gif” >’;
imgStr2 ='<img src=”<%=contextPath%>/images/ovacado.jpg”>’;

if ( dragObj.supported && typeof document.body.innerHTML != “undefined”) {

cntnt ='<table BORDER=0 CELLPADDING=0 CELLSPACING=0 cellpadding=”0″ class=”” width=”100″ height=”300″>’;
cntnt+='<tr><td>’;
cntnt+='<div>’ + imgStr1 + ‘</div>’;
cntnt+='</td>’;
cntnt+='<td>’;

cntnt+='<table cellpadding=”0″ cellspacing=”5″ bgcolor=”#F5F5D4″ class=”” width=”400″ height=”300″ >’;
cntnt+='<tr><td>’;
cntnt+='<div class=”img”>’ + imgStr + ‘</div>’;
cntnt+='</td><td><table cellpadding=”0″ cellspacing=”5″ >’;
cntnt+='<tr><td hieght=”50″><font size=”5″ color=”#A7A825″ ><b>’+ pdesc +'</b></font></td></tr>’;
cntnt+='<tr><td></td></tr>’;

cntnt+='<tr><td hieght=”100″><font>’+ pname +'</font></td></tr>’;
cntnt+='<tr><td>’;
cntnt+='<div class=”img”>’ + imgStr2 + ‘</div>’;
cntnt+='</td></tr>’;
cntnt+='</table></td></tr>’;
cntnt+='<tr><td></td>’;

cntnt+='<td align=”right”>’;
cntnt+='<div id=”handle”><a href=”javascript: void writeDrag.hide()”><img class=”xBox” src=”images/bx.gif” width=”12″ height=”12″ alt=”close box” border=”0″>Close Window</a></div>’;
cntnt+='</td></tr></table></td></tr></table>’;

cntnt+='</td></tr></table>’;

if (txt) cntnt += ‘<div class=”msg”>’ + txt + ‘</div>’;

// if (!wd) wd = w;
writeDrag.set(e, cntnt, wd, offx, offy);
} else { // non-capable browsers will open sub window
w = w+80 || wd || 250; h = h+80 || 250; // size
win = window.open(”, ‘subwin’, ‘resizable,width=’+w+’,height=’+h+’,left=100,top=100′,);
if (win && !win.closed) win.resizeTo(w,h);
str = ‘<html><head><title>Image Display</title></head>’;
str += ‘<body style=”text-align:center”>’;
str += imgStr + (txt? ‘<p>’ + txt + ‘</p>’:””);
str += ‘</body></html>’

win.document.write(str);
win.document.close();
if (win && !win.closed) win.focus();

}
return false;
}

</script>

…….

<img src=”<%=contextPath%>/images/payment/02_our_products_06.jpg” onclick=”return wrapContent(event, ‘<%=contextPath%>/<%=pb.getProdchgimg()%>’, ‘<%=pb.getProductname()%>’, ‘<%=pb.getProddes()%>’)” align=”top” onmouseover=”this.style.cursor=’hand'” >

……..

<!– write-drag layer here. handle and cntnt div’s are optional. (see other examples)
Specify border and padding inline if you are going to include them, so the script can read their values –>

<div id=”dragDiv” style=”position:absolute; visibility:hidden; left:0; top:0; z-index:inherit; background-color:#fff; border:0px solid #336;”>

<div id=”handle” style=”background-color:#339; text-align:right; font-size:8px;”>
</div>

<div id=”cntnt” style=”padding:2px; width: 400; height: 300;”></div>

</div>
<!– end write-drag layer –>

can any one say how to solve this problem?:mad:

Thanks in Advace.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@nap0leonDec 28.2007 — By "popup window" I presume you mean "floating DIV" (popup window implies that a new browser window is opened).

There is no fix. Select boxes will always "shine through" a DIV that is opened on top of them. Best workaround is to control the design of the page such that your pop-up DIVs are never positioned over the select boxes.
Copy linkTweet thisAlerts:
@A1ien51Dec 29.2007 — There is a way to do it. You position a iframe sized to the div and place it right under your div. This should only be a bug in IE6 and under.

Eric
×

Success!

Help @bhanupriya spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...