Ver Mensaje Individual
  #8 (permalink)  
Antiguo 06/03/2015, 12:03
Avatar de GeekGirl
GeekGirl
 
Fecha de Ingreso: julio-2014
Mensajes: 423
Antigüedad: 9 años, 9 meses
Puntos: 44
Respuesta: Modificar posición según ancho de pantalla

Tus condiciones se están solapando. Deberías hacer algo así:

Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3.     if ($(this).width() > 240 && $(this).width() < 740)){
  4.         $('.texto_inicial').css({
  5.             display: 'inline-block',
  6.             position: 'relative',
  7.             top: '800px',
  8.             background: '#FF0000'
  9.         });
  10.     }
  11.    
  12.     if ($(this).width() <= 240){
  13.         $('.texto_inicial').css({
  14.             display: 'inline-block',
  15.             position: 'relative',
  16.             top: '-825px',
  17.             background: '#FFDD00'
  18.         });
  19.     }
  20. });
  21. </script>