|
#1
|
||||
|
||||
|
Disable a certain javascript for an operating system?
Hello everyone,
I've discovered that on linux image_fade.js from simplicious templates has a strange behavior. In Windows everything is smooth, but on linux is a real headache, an image needs ~10 seconds to appear. Is there a way to test if the user uses linux and to use that .js in case he does? Thanks!
__________________
· I'm sorry if I make some mistakes here and there, english is not my native language. · Successfully using this method to fight spam since 01.03.2008. Spam comments encountered so far: 0. · photography - my website |
|
#2
|
||||
|
||||
|
*solved using jfgi method*
Code:
var OSName="Unknown OS";
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
document.write('Your OS: '+OSName);
HTML Code:
function initImage() {
if (navigator.appVersion.indexOf("Win")!=-1) {
imageId = 'photo';
image = document.getElementById(imageId);
setOpacity(image, 0);
image.style.visibility = "visible";
fadeIn(imageId,0);
}
else
{
imageId = 'photo';
image = document.getElementById(imageId);
setOpacity(image, 100)
image.style.visibility = "visible";
}
}
__________________
· I'm sorry if I make some mistakes here and there, english is not my native language. · Successfully using this method to fight spam since 01.03.2008. Spam comments encountered so far: 0. · photography - my website |
| Post Reply |
| Thread Tools | |
|
|