This is a very simple plug-in which will add an overlay to your forum when AWC is opened. The overlay is a stylish tranparant white (for dark boards, I'd recommend changing it to black).
This pulls focus on the chatbox, and overall just looks pretty cool to your users. Additionally, clicking on the overlay, will close the chatbox and go back into your forum.
Here's the plug in, just a small code adding 2 event handlers to AWC, utilizing the onopen and onclose events.
[bspoiler=Versions 1.6-1.8]
[bspoiler=Version 1.9+]
Then to style the overlay, use this CSS:
This pulls focus on the chatbox, and overall just looks pretty cool to your users. Additionally, clicking on the overlay, will close the chatbox and go back into your forum.
Here's the plug in, just a small code adding 2 event handlers to AWC, utilizing the onopen and onclose events.
[bspoiler=Versions 1.6-1.8]
- Code:
[panda=js]avacweb_chat_config.add_event('onopen', function() {
var o = document.getElementById('awc-overlay');
if(!o) {
o = document.createElement('div');
o.id = 'awc-overlay';
document.body.appendChild(o);
$(o).click(function() { avacweb_chat.toggle(); });
}
o.style.display = '';
});
avacweb_chat_config.add_event('onclose', function() {
var o = document.getElementById('awc-overlay');
if(o) o.style.display = 'none';
});
[bspoiler=Version 1.9+]
- Code:
[panda=js]avacweb_chat_config.add_event('onopen', function() {
var o = document.getElementById('awc-overlay');
if(!o) {
o = document.createElement('div');
o.id = 'awc-overlay';
document.body.appendChild(o);
$(o).click(function() { avacweb_chat.settings.toggle('open'); });
}
o.style.display = '';
});
avacweb_chat_config.add_event('onclose', function() {
var o = document.getElementById('awc-overlay');
if(o) o.style.display = 'none';
});
Then to style the overlay, use this CSS:
- Code:
[panda=css]#awc-overlay {
-moz-opacity: 0.5;
-webkit-opacity: 0.5;
background: #FFF; /* CHange this to #000 for darker themed boards */
filter: alpha(opacity=50);
min-height: 100%;
left: 0;
opacity: 0.5;
position: fixed;
top: 0;
width: 100%;
z-index: 999;
}