K. Weber
K. Weber

Reputation: 2773

Javascript executing only sometimes (Internet Explorer 7 and 8)

I'm using 2 pluigins for rounded corners, one for all navigators and DD_Roundies for IE, the IE code seems to be executing only sometimes, aparently has nothing to do with cache as I clean it and again some times I get rounded corners and some times I don't.

You can see it here (try to reload the page some times) or here, where the grey div saying "Solicite presupuesto" should be resized according to the first instruction after the else.

It seems more thing of javascript than of dd_roundies, as the first instruction after the else is not working always either, this is my code:

  $(document).ready(function()
    {
        var anchoDoc = getViewSize();
        //if (anchoDoc <= 1152) && (anchoDoc >1024)
        if ((anchoDoc <= 1024) && (anchoDoc >800))
            $('#css-dispositivo').attr('href', 'css/estructura1024.css');

        $('#contenido').corner('bottom', '40px');
        $('#pie-pagina').corner();

        //El plugin jquery.corners falla en IE cuando el fondo no es liso, por tanto se usa el plugin DD_roundies en IE para aquellos elementos con fondo
        //de imagen o degradado (el motivo de no usarlo en todos los elementos para IE es que DD_roundies sa peor resultado)
        if (navigator.appName.toLowerCase().indexOf('internet explorer') < 0)
        {
            $('#wrapper-animacion').corner();
            $('#solicitud-presupuesto').corner();
            $('.grupo-clientes').corner("30px");

            $('a.link-pie').corner('5px');
            $('.texto-destacado1').corner('right', '20px');

            $('#frmContacto .wrapper-campo').corner();
            $('#frmContacto .wrapper-textarea').corner();
        }
        else
        {
            $('#solicitud-presupuesto').css('width', '54%');
            DD_roundies.addRule('#wrapper-animacion', '10px');
            DD_roundies.addRule('#solicitud-presupuesto', '10px');
            DD_roundies.addRule('.grupo-clientes', '10px');

            DD_roundies.addRule('a.link-pie', '6px');
            DD_roundies.addRule('.texto-destacado1', '30px');

            DD_roundies.addRule('.wrapper-campo', '10px');
            DD_roundies.addRule('.wrapper-textarea', '10px');
        }
    });

Thank you

Upvotes: 0

Views: 211

Answers (1)

Jayne Mast
Jayne Mast

Reputation: 1487

I suggest using CSS3 and http://css3pie.com/ for rounded corners. It's faster DD_roundies and easier to use.

Upvotes: 1

Related Questions