Search code examples
jquerycssinline-styles

Finding where inline styles come from


I have a problem with a Prestashop page. Whenever I resize the window, my hero element get's a set of inline styles, a width set in pixels and a margin-left. I cannot override this with jQuery since these styles seem to be recalculated and re-added everytime the window changes. Is there something I can do about this?.

The url is: http://paolaq.com/test/es/


Solution

  • In your global.js file 621. line:

    function div_full_width(){
        var $ = jQuery;
        var contn_width = 1170;
        var window_width = $('#index').width();//$(window).width();
    
        // set container width
        if( window_width >= 1200 ) {
            contn_width = 1170;
        }else if( window_width >= 992 ){
            contn_width = 970;
        }else if( window_width >= 768 ){
            contn_width = 750;
        }else{
            contn_width = window_width;
        }
    
        $('.div_full_width').each(function(){
            $(this).css({
                //'margin-left': - ($(window).width() - $('#columns').width())/2,
                //'width': $(window).width()
                'margin-left': - (window_width - contn_width)/2,
                'width': window_width
            });
        });
    }