PDA

View Full Version : Logout 'fading' that works in IE, FireFox, Opera, etc



admin
21-11-2009, 04:52 PM
By default, the way vBulletin handles it, it will only work in Internet Explorer. Using the code below, however, it will work in IE, FireFox, Opera, (and should in others, but these are the only browsers I have installed http://www.vbulletin.org/forum/images/smilies/smile.gif ).

Note, though, it doesn't do the exact same style as vB default.


Installation:

In the clientscript/vbulletin-core.js file find:

/**
* Confirms log-out request
*
* @param string Log-out confirmation message
*
* @return boolean
*/
function log_out(confirmation_message)
{
var ht = document.getElementsByTagName("html")[0];
ht.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grays cale=1)";
if (confirm(confirmation_message))
{
return true;
}
else
{
ht.style.filter = "";
return false;
}
}

Replace with:

/**
* Confirms log-out request
*
* @param string Log-out confirmation message
*
* @return boolean
*/
function log_out(confirmation_message)
{
// You can change 30 and 0.3 to suit your 'tastes' :)
var bo = document.getElementsByTagName('body')[0];

bo.style.filter = 'Alpha(opacity="30")';
bo.style.MozOpacity = '0.3';
bo.style.opacity = '0.3';

if (confirm(confirmation_message))
{
return true;
}
else
{
bo.style.filter = 'Alpha(opacity="100")';
bo.style.MozOpacity = '1';
bo.style.opacity = '1';
return false;
}
}

Changelog:
1.0.2 - 16. Nov 2009
- Updated to vB 4.0.0

1.0.1 - 11. Jun 2007
- Updated 3.5.4 code
- Added a way to get this to work on 3.6.6+

1.0.0 - 25. Jul 2006
- Initial release


That's it. http://www.vbulletin.org/forum/images/smilies/smile.gif Enjoy!

3dviet
30-03-2010, 03:25 AM
Ai chỉ rõ giúp mình cái này công dụng như thế nào với đc ko?
Thanks

hoangduykt7990
04-04-2010, 02:15 PM
Hình như là khắc phục lõi log out ở Internet Explore thì phải! Nhưng anh admin có thể nói rõ cụ thể không vì 4rum em lâp cũng hay b log out nếu dùng IE lắm