Posted By

pablazo on 10/23/06


Tagged

javascript capas


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

luman
vali29


Capa flotante javascript


 / Published in: JavaScript
 

  1. <head>
  2. <script>
  3. var NAV=0;
  4. if(document.layers){
  5. NAV=1;
  6. } else if(document.all){
  7. NAV=2;
  8. }
  9.  
  10. function ajustarIdentificacion() {
  11. elem = document.getElementById('capaIdentificacion');
  12. if (elem != null){
  13. C = elem.style;
  14. C.top=PS();
  15. }
  16. return false;
  17. }
  18.  
  19. function PS(){
  20. var v=0;
  21. switch(NAV) {
  22. case 0: {v=window.pageYOffset;} break;
  23. case 1: {v=document.documentElement.scrollTop;} break;
  24. case 2: {v=document.body.scrollTop;} break;
  25. default: { v=0;}
  26. }
  27. return v;
  28. }
  29.  
  30. </script>
  31. </head>
  32. <body onScroll="ajustarIdentificacion();" >
  33. <div id="capaIdentificacion" style="position:relative; left:0px; top:0px; z-index:9;">
  34. contenido de la capa
  35. </div>
  36. </body>

Report this snippet  

You need to login to post a comment.