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.

knowing your computer system configuration online for intel

Hi,

may be this link be helpful to those having intel mainboard and not having much technical knowledge about how to know your system configuration.

You can check know your system configuration online by going to this page of official intel website.

http://www.intel.com/support/siu.htm

click on “Identify the products on your computer ” link and you will get basic and advanced report of your system configuration.

much helpful to me :)

Call to undefined function money_format()

Here’s the reason why it may not work, probably you are having windows platform

“The function money_format() is only defined if the system has strfmon capabilities. For example, Windows does not, somoney_format() is undefined in Windows. “

found the above statement on php.net

white-space: nowrap not working in ie

For non-ie browsers like mozilla the below code will work:

<table>

<tr>

<td style=”white-space: nowrap”>text here</td>

</tr>

</table>

but the above will not work for ie browser, so this is what will work for ie :

<table>

<tr>

<td><span  style=”white-space: nowrap”>text here</span></td>

</tr>

</table>

javascript pop-up window close event

Add the below javascript to the javascript pop-up window on the close event of which you want to execute a particular javascript funciton.

window.onbeforeunload =
 function(){
      // add the javascript code here which you want to execute at the close of this pop-up window
 }

modalbox javascript onclose event

Today after along period writing a post. I tried a new javascript library called modalbox js. Was working very good, but i had to run other javascript when the box was closed. Found some help at http://code.google.com/p/modalbox/wiki/MethodsReference but didn’t found the exact syntax.

After some trial and error finally succeeded, so thought to post on to the blog. Here is the syntax for javascript as well as for symfony (in case you are working with symfony)

Syntax for symfony:

<?php echo m_link_to(‘link_name’,
‘url’,
array(‘title’ => ‘title’),
array(‘width’ => 630, ‘height’ => 180, ‘afterHide’ => ‘afterhidealert‘)); ?>

here afterhidealert is the javascript function that will be called on the closing of the modalbox popup.

Syntax for javascript:

<a href=”url” onclick=”Modalbox.show(this.href, {afterHide:afterhidealert, height:180, title:this.title, width:630}); return false;” title=”title”>link_name</a>

here afterhidealert is the javascript function that will be called on the closing of the modalbox popup.

Thanks,

samsami2u

http://www.avidindiainc.com

Check out Save Our Tigers | Join the Roar

Title: Save Our Tigers | Join the Roar
Link: http://gotaf.socialtwist.com/redirect?l=-635043355222325288021

looping through the array in a reverse manner or reverse foreach in php

$array = array(‘foo’ => ‘bar’, ‘baz’, ‘bat’ => 2);
end($array);
while (key($array) !== null) {
echo key($array) .”: ” .current($array) . PHP_EOL;
prev($array);
}

Error levels and their values in php

Value Constant Description
2 E_WARNING Non-fatal run-time errors. Execution of the script is not
halted
8 E_NOTICE Run-time notices. The script found something that might be
an error, but could also happen when running a script normally
256 E_USER_ERROR Fatal user-generated error. This is like an E_ERROR set by
the programmer using the PHP function trigger_error()
512 E_USER_WARNING Non-fatal user-generated warning. This is like an E_WARNING
set by the programmer using the PHP function trigger_error()
1024 E_USER_NOTICE User-generated notice. This is like an E_NOTICE set by the
programmer using the PHP function trigger_error()
4096 E_RECOVERABLE_ERROR Catchable fatal error. This is like an E_ERROR but can be
caught by a user defined handle (see also set_error_handler())
8191 E_ALL All errors and warnings, except level E_STRICT (E_STRICT
will be part of E_ALL as of PHP 6.0)
Follow

Get every new post delivered to your Inbox.