Elxis CMS Forum

Support => General => Topic started by: babis1 on July 03, 2008, 14:01:21

Title: say no to internet explorer 6
Post by: babis1 on July 03, 2008, 14:01:21
make a js file and named say.no.to.ie.6.js with this code (change the parametres div.style.background in where you have a popup image -make your own pop up image for the warnings p.e. you see our site with ie 6 please update in ie7 to see all our contents)
Code: [Select]
var IE6 = (navigator.userAgent.indexOf("MSIE 6")>=0) ? true : false;
if(IE6){
window.attachEvent("onload", function(){
var now = new Date();
var time = now.getTime();
var div = document.createElement('a');
var id = 'saynotoie6_div_' + time;
div.setAttribute('id',id);
div.setAttribute('href','http://www.microsoft.com/windows/downloads/ie/getitnow.mspx/');
div.setAttribute('target','new_window');
div.style.display = 'block';
div.style.color = '#1d1d1d';
div.style.textAlign = 'left';
div.style.fontFamily = 'Arial,sans-serif';
div.style.fontSize = '11px';
div.style.background = 'url(http://www.mysite.gr/images/popDown.gif)';
div.style.padding = '0';
div.style.position = 'absolute';
div.style.top = '0';
div.style.right = '40px';
div.style.zIndex = '999999';
div.style.width = '330px';
div.style.height = '63px';
div.style.marginTop = '-80px';
div.style.filter = 'alpha(opacity=95)';
document.body.appendChild(div);

var stdorg_animate = function(){
var myDiv = document.getElementById(id);
var value = parseInt(myDiv.style.marginTop);
myDiv.style.marginTop = value + 1 + 'px';
if(parseInt(myDiv.style.marginTop) < -1){
var timer = setTimeout(stdorg_animate,30 * 80/Math.abs(value) * .27);
}else{
var timer = setTimeout(stdorg_hide,5000);
}
};

var stdorg_hide = function(){
var myDiv = document.getElementById(id);
var value = parseInt(myDiv.style.marginTop);
myDiv.style.marginTop = value - 1 + 'px';
if(parseInt(myDiv.style.marginTop) > -80){
var timer = setTimeout(stdorg_hide,1.4 * 80/Math.abs(value) * 3.70);
}
};

setTimeout(stdorg_animate,1000);
});
}

and upload to your server.
after go to your index.php (template file) and before the </body>write this
<script src="http://www.mysite.gr/say.no.to.ie.6.js"  type="text/javascript"></script>( i forgot the type that is important at the case you want pass xhtml validation....sorry)
see how it work in http://www.infoperisteri.gr (see the site with ie 6)

this is an idea from the gays who have the http://www.savethedevelopers.org/

if you want to change the popup image change those parametres
div.style.width = '330px';
      div.style.height = '63px';
with the width and height to your own image and go this
div.style.right = '40px'; ...to 0px