ive created a lightbox where I have centered the div horizontally and vertically with a fixed position and jquery.
Everything works perfect except in ie8 it seems that it doesnt subtract the object width and height.
That way it is not in the very center of the screen instead its a little to the bottom and the right.
Any ideas how to make this work well?
function lightbox(){
var w_width = $(window).width();
var w_height = $(window).height();
var obj_width = $('.image_big').width();
var obj_height = $('.image_big').height();
$('#image_big').css('top', (w_height / 2) - (obj_height / 2)).css('left', (w_width / 2) - (obj_width / 2))
}
lightbox();
$(window).resize(function(){
lightbox();
});
semicolon(;) mistake I think.
Also post the style you are using, it should be
position:fixed