Ver Mensaje Individual
  #8 (permalink)  
Antiguo 25/11/2011, 04:25
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
Respuesta: como puedo sacar la posicion de el background-image

segundo código

Código Javascript:
Ver original
  1. <html>
  2.     <head>
  3.         <title>Computed Style Example</title>
  4.         <style type="text/css">
  5.             div.special {
  6.                 background-color: red;
  7.                 margin: 10px;
  8.                    background-position: 0 -30px;
  9.             }
  10.         </style>
  11.         <script type="text/javascript">
  12.             function getBackgroundColor() {
  13.                 var oDiv = document.getElementById("div1");
  14.                 alert(oDiv.currentStyle.margin);
  15.             }
  16.         </script>
  17.  
  18.     </head>
  19.     <body>
  20.         <div id="div1" class="special">para explorer</div>
  21.         <input type="button" value="Get Background Color" onclick="getBackgroundColor()" />
  22.        
  23.     </body>
  24. </html>