Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css in chrome only works after inspect element

I am using flexslider JQuery plugin to slideshow several elements in my site. I also use JQuery .click() event and fadeIn() fadeOut() effects on the elements that apply flexslider.

my site looks fine in firefox, but when i open it in chrome, the slides are stacked in one page. but what confuses me is, when i use inspect element in chrome, it sets the layout right, just like in firefox.

can anyone explain what's happening?

EDITED: okay after some inspection, the layout changes when the width/height is changed, so here's the css i use on the element that doesn't display properly:

#content{
    width: 80%;
    margin: 2% 10%;
    padding: 3% 1%;
    -webkit-border-radius: 10px;
       -moz-border-radius: 10px;
            border-radius: 10px;
    background-color: rgba(255,255,255,0.5);
    -webkit-box-shadow: 0 2px 3px 0 #aaa;
       -moz-box-shadow: 0 2px 3px 0 #aaa;
        box-shadow: 0 2px 3px 0 #aaa;
    }
h2{
    width: 80%;
    margin: 5% 10%;
    color: #808080;

    font-family: "Lobster", Arial;
    font-weight: bold;
    font-size: 5em;

    line-height: 1em;
    text-align: center;
}

the flexslider is placed within #content, and inside the slides are elements with h2 tags

like image 332
atnatn Avatar asked Nov 26 '22 11:11

atnatn


1 Answers

I had similar problem where the css won't load after I had .trigger('click')

and it loaded when I used inspect element in chrome

I solved the problem by having a pause before the .trigger('click') is triggered

for example :

$('#workDone').click(function(){

             setTimeout(function(){$('#mefirst').trigger('click');}, 100); //providing delay to buffer load time of css


             });
like image 66
Snedden27 Avatar answered Nov 29 '22 03:11

Snedden27