Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/11/2011, 03:48
Avatar de jor_0203
jor_0203
 
Fecha de Ingreso: octubre-2011
Ubicación: mexico
Mensajes: 760
Antigüedad: 12 años, 6 meses
Puntos: 8
como puedo sacar la posicion de el background-image

como puedo sacar la posición de el background-image
con javascript
Código Javascript:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <title>contador</title>
  6. <style type="text/css">
  7. <!--
  8. .menu ul li{
  9.     background-image: url(jjjj.gif);
  10.     background-position: 0px 0px;
  11.     background-repeat: no-repeat;
  12.     list-style-type: none;
  13. }
  14. -->
  15.     </style>
  16. <script type="text/javascript">
  17. function posicion(){
  18. var cambiar = document.getElementById('me').backgroundPosition;
  19. var unos = document.getElementById("uno").innerHTML = cambiar;  
  20.                        }
  21. </script>
  22. </head>
  23. <body >
  24. <div id="uno"></div>
  25. <div class="menu">
  26.                 <ul>
  27.                       <li id="me" onClick="posicion()" >home</li>
  28.                 </ul>
  29. </div>
  30. </body>
  31. </html>