Jump to content

Opera And Chrome Offsettop Problems


Recommended Posts

I've made a drop down menu that uses offsetLeft and offsetTop to position the dropdown menu. It works in Firefox and Safari but not Opera or Chrome (haven't tried IE yet because it's got other problems). In chrome and opera, offsetLeft works fine, but offsetTop does not.Right:menuright.pngWrong:menuwrong.pngCode:

	function displaymenu(){	button = document.getElementById("menubutton");	left = button.offsetLeft + "px";	top = button.offsetTop;	top = top + 25 + "px";	menu = document.getElementById("menudropdown").style;	menu.top = top;	menu.left = left;	menu.visibility = "visible";}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...