overlay div pop up not working in google chrome

Okay, here is the issue and solution

Problem: i found a java script across internet for div pop up using overlay, working fine with all browsers except chrome. In chrome it would execute to create a popup but its position was top left of the screen and was viewable less than 50%.

Solutions: here is the solution.

if (!window.ie6) {
this.overlay.setStyles({
position: ‘fixed’,
top: 0,
left: 0
});
this.window.setStyles({
position: ‘fixed’,
top: ’50%’,
left: ’50%’
});
} else if (navigator.userAgent.indexOf(‘Chrome’) !=1) {

this.overlay.setStyles({
position: ‘absolute’,
top: ’0%’,
left: ’0%’
//,marginTop: “expression(document.documentElement.scrollTop + ‘px’)”
});

this.window.setStyles({
position: ‘absolute’,
top: ’50%’,
left: ’50%’
//,marginTop: “(expression(0 – parseInt(this.offsetHeight / 2) + document.documentElement.scrollTop + ‘px’)”
});

}else {
this.overlay.style.setExpression(‘marginTop’, ‘document.documentElement.scrollTop + “px”‘);
this.window.style.setExpression(‘marginTop’, ’0 – parseInt(this.offsetHeight / 2) + document.documentElement.scrollTop + “px”‘);

this.overlay.setStyles({
position: ‘absolute’,
top: ’0%’,
left: ’0%’
//,marginTop: “expression(document.documentElement.scrollTop + ‘px’)”
});

this.window.setStyles({
position: ‘absolute’,
top: ’0%’,
left: ’0%’
//,marginTop: “(expression(0 – parseInt(this.offsetHeight / 2) + document.documentElement.scrollTop + ‘px’)”
});
}

facebook connect logout not working

just few days ago i needed to integrate “facebook Connect” to a website. With the documentation provided by facebook it was quite easy to integrate it. But i faced one issue that i was not able to find out solution.

The problem: There is a method provide in Facebook php library : “get_loggedin_user()“  Now this function returns the profile id of the user if the user is logged in using facebook before landing to the website or after coming to the website(through facebook connect). But if i logged out of facebook, this function still returned me the profile id of that user one or more time after refreshing the page. due to which i was not able to log out of the website.

Solution: I searched the web for the solution and found few, but none of them worked for me. I tried to delete facebook cookies through facebook library functions and manually too but in vain. Finally i thought of a solution myself and it worked for me. The solution is when i logged out of the website i logged out of facebook and set a special session variable to 1. Now i will check if that variable is one i will not log in the website despite of getting profile id through “get_loggedin_user()”. and once page is loaded i will set that special session variable to 0.

This solved the issue for me for now.

Follow

Get every new post delivered to your Inbox.

Join 25 other followers