ricmetal Posted September 16, 2012 Share Posted September 16, 2012 not sure where to post this but is there any way that i can see what z-indexes are being used up in a html page, with either php or javascript, or anything else? Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/ Share on other sites More sharing options...
Mahngiel Posted September 16, 2012 Share Posted September 16, 2012 You can take a look at Firebug extensions or if you're using a modern browser, the 'Inspect Element / Web Page' from the right-click context menu: http://prntscr.com/fnvrz Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378375 Share on other sites More sharing options...
ricmetal Posted September 16, 2012 Author Share Posted September 16, 2012 thanks i am looking to list the z-indexes used though, the extensions just show the indexes near every element not the best way, but still good. thanks Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378452 Share on other sites More sharing options...
Mahngiel Posted September 16, 2012 Share Posted September 16, 2012 z-indexes are defined by the flow of the document. z-indexes are only set when this natural setting needs to be over-ridden. Such cases are fancy navigation menus. Firebug will display this if it is set. Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378460 Share on other sites More sharing options...
ricmetal Posted September 16, 2012 Author Share Posted September 16, 2012 yeah, i know about the ordering of z-indexes thus, about it's manipulation, thus the need to get a list of the ones used the extension will do fine, but what i hoped for was a bullet pointed list of the ones used. regards Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378463 Share on other sites More sharing options...
Mahngiel Posted September 16, 2012 Share Posted September 16, 2012 the extension will do fine, but what i hoped for was a bullet pointed list of the ones used. where would you expect to find it if it is not defined? you'll need to just test it out... again, look at firebug Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378464 Share on other sites More sharing options...
ricmetal Posted September 16, 2012 Author Share Posted September 16, 2012 idk i highly doubt a piece of software can't collect data on what z-indexes are used, after a page loads yes, you've mentioned the extensions. these show what z-indexes have manually been set. plus the info appears next to each element, not ordered. Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378470 Share on other sites More sharing options...
Mahngiel Posted September 16, 2012 Share Posted September 16, 2012 idk i highly doubt a piece of software can't collect data on what z-indexes are used, Browser engines do this. Are you trying to do something in particular or just gathering intel? Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378475 Share on other sites More sharing options...
ricmetal Posted September 16, 2012 Author Share Posted September 16, 2012 just gathering intel. im starting to mess with multiple z-indexes and i start to need to know what z-indexes i use Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378479 Share on other sites More sharing options...
Christian F. Posted September 17, 2012 Share Posted September 17, 2012 You normally use a z-index of 0, unless you manually specify anything else. Which means that they'll stack based upon their order in the DOM, with the first element being at the bottom. So I'm not quite sure why you'd want to find out what's already in use. Normally you'd just set the z-index of the container to a positive value, and then set the z-indices of the children elements to the values needed to achieve the desired stacking order. Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378538 Share on other sites More sharing options...
ricmetal Posted September 17, 2012 Author Share Posted September 17, 2012 say i have a few elements that have their z-index set manually by a script (assume they are modals, so they need to stack over others) so i need to know which z-indexes are being populated so i can add more modals. Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378677 Share on other sites More sharing options...
Mahngiel Posted September 17, 2012 Share Posted September 17, 2012 like i've told you before, if you've set it manually, it'll be visible through something like firebug. However, displaying something over a modal defeats the purpose of the modal. Also, if you set the modal parent's z-index, every one of it's children becomes +1 to the value you've set. But if for some reason you'd like a toolbar (or other random element) to be over the modal, then be sure to set it's value higher than the modal. You're writing the CSS, so you should know it's value anyway. And if you get lost, just give it a look up. Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378681 Share on other sites More sharing options...
ricmetal Posted September 17, 2012 Author Share Posted September 17, 2012 the extensions i've found so far don't show the information on the elements that are hidden by default (like modals), so they are not very usefull. Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378697 Share on other sites More sharing options...
Mahngiel Posted September 17, 2012 Share Posted September 17, 2012 the extensions i've found so far don't show the information on the elements that are hidden by default (like modals), so they are not very usefull. yea, i guess you're right Quote Link to comment https://forums.phpfreaks.com/topic/268432-finding-out-what-z-index-are-used/#findComment-1378729 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.