MooTools Stop Internet Explorer 6 bar

Which webdeveloper does like Internet Explorer 6? Not many I guess. Therefore there are many Stop IE6 campains, like Activebar2. But what? jQuery... What a pitty, that must be a big overhead to load the whole jQuery library when you use MooTools. So I ported it to MooTools. Like Activebar2 you can use this for any kind of information you want you present your users with ease.

Demo

If you use IE6 (why ??:(.. ), you should already see the bar at the top. If you do not use IE6, you can click this link to open the bar.

Example Code

Javascript	
window.addEvent('domready',function(){
	
	if (Browser.Engine.trident && Browser.Engine.version <= 4) {
		$(document.body).stopIE6();
	}

});

If you do not want to download the stopIE6.js file if you are not browsing with IE6, you can use conditional comments.

HTML	
<!--[if lte IE 6]>

<script src="stopIE6.js" type="text/javascript"></script>
<script type="text/javascript">
window.addEvent('domready',function(){
	
	if (Browser.Engine.trident && Browser.Engine.version <= 4) {
		$(document.body).stopIE6();
	}
	
});
</script>

<![endif]--> 

More advanced stuff

Javascript	
window.addEvent('domready',function(){
	
	if (Browser.Engine.trident && Browser.Engine.version <= 4) {

		// If you want another text, you can use the html option
		
		$(document.body).stopIE6({
			html: 'I Do Not Like Internet Explorer Six, So 2001.'
				+'use Firefox, Opera, Google Chrome or Safari instead!'
		});
		
		// The html option does also handle elements
		// you can create a new element
		$(document.body).stopIE6({
			html: new Element('div',{
				text: 'I Do Not Like Internet Explorer Six, So 2001.'
				+'use Firefox, Opera, Google Chrome or Safari instead!'
			})
		});
		
		// Or use a element that is already in the DOM		
		$(document.body).stopIE6({
			html: document.id('myStopIE6Element')
		});
		
	}

});

Documentation

Syntax:

myElement.stopIE6([options]);

Arguments:

  1. options - (object,optional) An object with options for the drop menu. See below

Options:

Events:

Download & links

Dependencies

License

MIT-style license.

Created By

Aryweb Webdevelopment