vForums Support Banner


Visit Base Classics - Gaming Chairs

 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Bring element to top (z-index) - View Topic
Topic Rating: *****
Printable View
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Bring element to top (z-index) (11th Jan 10 at 7:27pm UTC)
Resolved
Code:
 
  1. <script>
  2. var TopZ = 101;
  3. function SetZ(WinID){
  4. TopZ++
  5. get(WinID,'id').style.z-index = TopZ;
  6. }
  7. </script>
 


I want it so every time you "open" certain elements they are brought to the top and if you have one above another if you click the lower one it will bring it to the top

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Bring element to top (z-index) (11th Jan 10 at 7:35pm UTC)
Code:
 
  1. <script>
  2. var TopZ = 101;
  3. function SetZ(WinID){
  4. TopZ++
  5. get(WinID,'id').style.zIndex = TopZ;
  6. }
  7. </script>
  8.  
  9. <div id = 'x' onclick = "SetZ('x');" style = 'position: relative; top: 15px; left: 10px; padding: 50px; border: 1px solid #000000; background: #800000; color: #FFFFFF; width: 200px;'>
  10. RAWR!
  11. </div>
  12. <div id = 'y' onclick = "SetZ('y');" style = 'position: relative; top: -15px; left: 20px; padding: 50px; border: 1px solid #000000; background: #800000; color: #FFFFFF; width: 200px;'>
  13. RAWR2!
  14. </div>
  15. <div id = 'z' onclick = "SetZ('z');" style = 'position: relative; top: -40px; left: 30px; padding: 50px; border: 1px solid #000000; background: #800000; color: #FFFFFF; width: 200px;'>
  16. RAWR3!
  17. </div>
  18. <div id = '1' onclick = "SetZ('1');" style = 'position: relative; top: -45px; left: 40px; padding: 50px; border: 1px solid #000000; background: #800000; color: #FFFFFF; width: 200px;'>
  19. RAWR4!
  20. </div>
 


The JS to change the Z-Index is
x.style.zIndex = 'number';
{Smile}
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Bring element to top (z-index) (11th Jan 10 at 7:41pm UTC)
Works exactly the way I want it to, thanks

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Bring element to top (z-index) (11th Jan 10 at 7:58pm UTC)
You're welcome! {Smile}
 Printable View

All times are GMT+0 :: The current time is 4:35am
Page generated in 1.7835 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums