tcrisera
01-27-2009, 04:58 PM
I'm trying to display a DIV w/ detail info that corresponds to a dropdown list option. I'm trying to place it at a set location on the right side of the page. The following code snippets work fine in Firefox, but not in IE 6.
<div id="divVendorDetail_1" style="border: solid 1px #214273;position: absolute;display:none;background-color: #ffffff;z-index: 200;">
<table border="0" cellpadding="2" cellspacing="0" width="350">
...
</div>
<select name="cboVendorList" onchange="submitFindVendor('VendorAdministration')" ">
<option value="1" onmouseover="showVendorDetails('divVendorDetail_1')"
onmouseout="hideVendorDetails('divVendorDetail_1')"></option>
function showVendorDetails(divName) {
if(divName.length < 1) { return; }
document.getElementById(divName).style.visibility = 'visible';
document.getElementById(divName).style.display = 'block';
var cX = 0; var cY = 300;
if (window.innerWidth) { //if browser supports window.innerWidth
cX = window.innerWidth - 400;
}
else
if (document.all) { //else if browser supports document.all (IE 4+)
cX = document.body.clientWidth - 400;
}
document.getElementById(divName).style.left = (cX) + "px";
document.getElementById(divName).style.top = (cY) + "px";
}
Tried some alerts, but didn't even seem to work at the top of the function in IE6. Any help appreciated, javascript not my longsuit, especially cross browser issues.
Thanks, TC
<div id="divVendorDetail_1" style="border: solid 1px #214273;position: absolute;display:none;background-color: #ffffff;z-index: 200;">
<table border="0" cellpadding="2" cellspacing="0" width="350">
...
</div>
<select name="cboVendorList" onchange="submitFindVendor('VendorAdministration')" ">
<option value="1" onmouseover="showVendorDetails('divVendorDetail_1')"
onmouseout="hideVendorDetails('divVendorDetail_1')"></option>
function showVendorDetails(divName) {
if(divName.length < 1) { return; }
document.getElementById(divName).style.visibility = 'visible';
document.getElementById(divName).style.display = 'block';
var cX = 0; var cY = 300;
if (window.innerWidth) { //if browser supports window.innerWidth
cX = window.innerWidth - 400;
}
else
if (document.all) { //else if browser supports document.all (IE 4+)
cX = document.body.clientWidth - 400;
}
document.getElementById(divName).style.left = (cX) + "px";
document.getElementById(divName).style.top = (cY) + "px";
}
Tried some alerts, but didn't even seem to work at the top of the function in IE6. Any help appreciated, javascript not my longsuit, especially cross browser issues.
Thanks, TC