Fade with IE8 jquery header message problem

I have a problem with my fading heading in jquery .. my problem is as follows. Rolling messages in the header are launched into the page body in IE8.

Please, I left the URL here.

http://www.aerocom.net.au/index.php?id=contact-us

Thanks in advance

+4
source share
1 answer

Perhaps because of this line (from aerocom.js) that sets the width of the header:
$('#gallery .caption').css({width: $('#gallery a').find('img').css('width')});

You are trying to get the width of the image on the finished document, but before loading the image and therefore the width is 0.

You can get the loading width of the window when the image loaded:

 $(window).load(function() { $('#gallery .caption').css({width: $('#gallery a').find('img').css('width')}); }); 

Or continue to use the finished document and set the width in the img tag:

 <img width="980" src="http://www.aerocom.net.au/theme/Default_Simple/image/banner/banner4.jpg"> 

I would recommend the first one. I would also set the height. In this case, the browser may skip several skews during the initial rendering of the page, which means faster loading.

+1
source

Source: https://habr.com/ru/post/1305411/


All Articles