vForums Support Banner



 

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: 330
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 20
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Bring element to top (z-index) (11th Jan 10 at 2:27pm EST)
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: 3,974
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 55%  


pmtwitter vForum
Re: Bring element to top (z-index) (11th Jan 10 at 2:35pm EST)
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: 330
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 20
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Bring element to top (z-index) (11th Jan 10 at 2:41pm EST)
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: 3,974
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 55%  


pmtwitter vForum
Re: Bring element to top (z-index) (11th Jan 10 at 2:58pm EST)
You're welcome! {Smile}

 Printable View

All times are GMT+0 :: The current time is 5:47am
Page generated in 0.317 seconds
with 31 Database Queries and 0 cache files
This Forum is Powered By vForums (v2.3)
Create a Forum for Free | Find Forums