Jump to content

Problem on z-index:1


rynix
 Share

Recommended Posts

:) Hi guys , i having a problem on the following code of the button i had set to z-index:1 but when this button point to drop down list , the drop down list will cover the button ... any idea on this problem ? thank you .<html><head><script type="text/javascript">var timerfunction scrolltop(){document.getElementById('scrollmenu').style.pixelTop=document.body.scrollToptimer=setTimeout("scrolltop()",1)}function stoptimer(){clearTimeout(timer)}</script></head><body onload="scrolltop()" onunload="stoptimer()"><span id="scrollmenu" style="position:absolute;z-index:1"><br /><input type = button value ="always on top"></span><table border="0" width="100%"><tr><td width="100"> </td><td>Scroll this page to see the "always-on-top" button<br /><br /><br /><br /><br />Scroll this page to see the "always-on-top" button<br /><br /><br /><br /><br /><select><option>HERE</option></select><br /><br /><br /><br /><br />Scroll this page to see the "always-on-top" button<br /><br /><br /><br /><br />Scroll this page to see the "always-on-top" button<br /><br /><br /><br /><br />Scroll this page to see the "always-on-top" button<br /><br /><br /><br /><br />Scroll this page to see the "always-on-top" button<br /><br /><br /><br /><br />Scroll this page to see the "always-on-top" button<br /><br /><br /><br /><br />Scroll this page to see the "always-on-top" button<br /><br /><br /><br /><br />Scroll this page to see the "always-on-top" button<br /><br /><br /><br /><br /></td></tr></table></body></html>
Link to comment
Share on other sites

I've had that problem too. It messed up a couple weeks of programming that I had made when I discovered it.As far as I know, after poking around the web for days trying to find a solution to this problem, I couldn't find anything. I think this is a generally accepted CSS error. The z-index isn't registered or it's overridden or something like that. If it could help, try using the "visibility" property(or maybe it's called attribute). You can set it to "hidden" or "visible"as such.

<img src="something.png" style="visibility:hidden;" />

You can also set it to "collapse" to collapse, in a sense, a table row or column without affecting the table, row, or column dimmensions. To read more about these three options, go here: http://www.w3schools.com/css/pr_class_visibility.asp

Link to comment
Share on other sites

z-index and visibility are not the same thing, they are not even close. z-index sets the "layer" order for absolutely positon elements and visibility hides or shows elements.
Ok then, I must have not understood the question. I thought he could use the visibility attribute to somehow work with the drop-down list.
Link to comment
Share on other sites

for-what-ever reason select boxes always show over top of all other elements (I think this is IE only). The only way to stop this is to use javascript and hide the select box under certain conditions if you do not want it to show over other layers.

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
 Share

×
×
  • Create New...