
08-11-2011, 17:53:22
|
| |
Açılır Menü Sorunu | |
İe dışında hiçbir tarayıcıda menüler çalışmıyor fakat mozilla veya chrome de menüler açılıyor ama tıklanmıyor bunu nasıl düzeltebilirim ?
menu.js nin kodları burda yardım ederseniz sevinirim teşekkürler şimdiden. Kod: var tabloKod = Array();
var gosterim = true;
var globalBtnId;
if (document.createElement){
var menuDiv = document.createElement('div');
menuDiv.id = 'menu';
menuDiv.style.position = 'absolute';
menuDiv.style.zindex = '99';
menuDiv.style.display = 'none';
}
var ie = false;
if (document.all) { ie = true;}
function buton(btnId) {
if (ie) { return document.all[btnId]; }
else { return document.getElementById(btnId); }
}
function setDiv() {
menuDiv.innerHTML = menuOlustur();
document.body.appendChild(menuDiv);
}
function menuAc(btnId) {
globalBtnId = btnId;
setDiv();
menuDiv.style.display == 'none';
var thelink = buton(btnId);
menuDiv.style.top = butonUstKonum(thelink);
menuDiv.style.left = butonSolKonum(thelink);
menuDiv.style.display = 'block';
gosterim = true;
menuGizle();
}
function menuGizle(){
//alert(gosterim);
if (!gosterim){
menuDiv.style.display = 'none';
} else {
setTimeout('menuGizle()',1000);
}
}
function linkEkle(linkButon,linkAdi,linkUrl) {
if (tabloKod[linkButon] == undefined){tabloKod[linkButon] = '';}
if (linkAdi){
tabloKod[linkButon] += '<a href="'
+ linkUrl + '"><tr>\n<td style="cursor:pointer; background-color:'
+ tabloRenk + '; color:'
+ linkRenk + ';" onMouseOver="this.style.backgroundColor=\''
+ '#000000' + '\'; this.style.color=\''
+ linkRenk + '\';" onMouseOut="this.style.backgroundColor=\''
+ tabloRenk + '\'; this.style.color=\''
+ linkRenk + '\';"> » '
+ linkAdi + ' </td>\n</tr></a>\n';
}
}
function menuOlustur() {
var tablo;
tablo = '<table width="' + butonGenislik(globalBtnId) + '" height="' + butonYukseklik(globalBtnId) + '" style="cursor:pointer;" onMouseOver="gosterim = true;" onMouseOut="gosterim = false;" border="0" cellpadding="0" cellspacing="0"><tr><td height="20"></td></tr></table>';
tablo += '<table onMouseOver="gosterim = true;" onMouseOut="gosterim = false;" border="' + tabloBorder + '" bordercolor="' + tabloBorderRenk + '" cellpadding="3" cellspacing="0" style="border-collapse:collapse;">\n' + tabloKod[globalBtnId];
tablo += '</table>';
return tablo;
}
function butonUstKonum(btn) {
var ust = btn.offsetTop;
var parent = btn.offsetParent;
while (parent != document.body) {
ust += parent.offsetTop;
parent = parent.offsetParent;
}
return ust;
}
function butonSolKonum(btn) {
var sol = btn.offsetLeft;
var parent = btn.offsetParent;
while (parent != document.body) {
sol += parent.offsetLeft;
parent = parent.offsetParent;
}
return sol;
}
function butonGenislik(btn) {
var genislik = buton(btn).offsetWidth;
return genislik;
}
function butonYukseklik(btn) {
var yukseklik = buton(btn).offsetHeight;
return yukseklik;
} |