
Along with jQuery, we have used third party module facebox for hindi lyrics. During testing different browsers, I got problem with placement of facebox.
In internet explorer (IE 6 & 7) it got aligned left.
So, finally I tried some cross browser hack for it. I have done some little change in facebox.js
At the end of function,
$.facebox.reveal = function(data, klass) {
I have added followng line,
if(jQuery.browser.msie){
b = $(”BODY”).width();
pl = (b - $(’#facebox .content’)[0].offsetWidth)/2;
$(’#facebox’)[0].style.paddingLeft = pl;
}
}
Explanation:-
[1] If browser is Internet Explorer, it gets width of view port into b variable
[2] Now facebox with is $(’#facebox .content’)[0].offsetWidth
[3] So, required left padding is (total screen width - box with)/2
[4] $(’#facebox’)[0].style.paddingLeft = pl line properly aligns the facebox.
May 19th, 2008 at 10:18 pm
I tried but on the first time that i click to open the facebox, it still gets aligned on the left, only after the first click the box gets center aligned.
And I still got the double content problem on IE. ¬¬
Facebox is giving me a lot of trouble. =/