Hi i' am using a script to show a pulldown menu on my internetsite but it doesn't seem to work in firefox.
Because the script uses ( i've downloaded it from a free javascript site) "getBoundingClientRect()" but Firefox doesn't support this.
My experience with javascript is not all that so i hoop dat someone could help me?!
Below are the 2 function that use the "getBoundingClientRect()" function
Because the script uses ( i've downloaded it from a free javascript site) "getBoundingClientRect()" but Firefox doesn't support this.
My experience with javascript is not all that so i hoop dat someone could help me?!
Below are the 2 function that use the "getBoundingClientRect()" function
Code:
function ShowMenu(obj_id) {
HideMenu('menuBar')
var obj = document.getElementById(obj_id);
var menu= document.getElementById(obj.getAttribute('menu') )
var bar = document.getElementById(obj.id)
bar.className="barOver"
menu.style.visibility = "visible"
//menu.style.pixelTop = obj.offsetTop + obj.offsetHeight + document.getElementById('Bdy').scrollTop
//menu.style.pixelLeft = obj.offsetLeft + document.getElementById('Bdy').scrollLeft
menu.style.pixelTop = obj.[COLOR=red]getBoundingClientRect()[/color].top + obj.offsetHeight + document.getElementById('Bdy').scrollTop
menu.style.pixelLeft = obj.[COLOR=red]getBoundingClientRect()[/color].left + document.getElementById('Bdy').scrollLeft
}
Code:
function ShowSubMenu(obj_id) {
var my_obj = document.getElementById( obj_id );
window.alert("tada7a: id=" + my_obj.id );
PMenu = document.getElementById(my_obj.parentElement.id)
HideMenu(PMenu.id)
window.alert("tada7b: id=" + my_obj.id+ " menu="+my_obj.getAttribute('menu') );
if(my_obj.getAttribute('menu') !== null &&
my_obj.getAttribute('menu') !== undefined ) {
var menu = document.getElementById( my_obj.getAttribute('menu') )
menu.style.visibility = "visible"
menu.style.pixelTop = my_obj.[COLOR=red]getBoundingClientRect()[/color].top + document.getElementById('Bdy').scrollTop
menu.style.pixelLeft = my_obj.[COLOR=red]getBoundingClientRect()[/color].right + document.getElementById('Bdy').scrollLeft
if(menu.[COLOR=red]getBoundingClientRect()[/color].right > window.screen.availWidth ) {
menu.style.pixelLeft = my_obj.[COLOR=red]getBoundingClientRect()[/color].left - menu.offsetWidth
}
}
}