想知道你是否有人可以帮助我:
我做了一个注册模式,它使用CSS转换在两种注册方法之间切换。我决定尝试'卡片翻转'效果。
我一直在尝试使用JQuery和条件CSS来'显示:无'在IE(和旧浏览器)中加载'后退',然后添加'display:block;'在点击时显示它的类,问题是,我是一个JQuery初学者,一直在努力让它工作!甚至不确定这是否是最佳方法?任何人都可以建议一种能够在功能较少的浏览器中运行的方法吗?
感谢您的任何建议..
答案 0 :(得分:0)
$().ready(function(){
var userAgent = navigator.userAgent.toLowerCase();
$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
var browserName = '';
var version = '';
var displayPop = false;
var chromeversion=11; //working when chrome have version below 11
var safariversion=5; //working when safari have version below 5
var firefoxversion=3.6; //working when firefox have version below 3.6
var miseversion=9; //working when ie have version below 9
var operaversion=10; //working when opera have version below 10
if ($.browser.chrome) {
userAgent = userAgent.substring(userAgent.indexOf('chrome/') + 7);
userAgent = userAgent.substring(0, userAgent.indexOf('.'));
$.browser.version = userAgent;
$.browser.safari = false;
browserName = 'Chrome';
version = $.browser.version;
displayPop= parseInt(version) < chromeversion ? true : false;
} else if ($.browser.safari) {
userAgent = userAgent.substring(userAgent.indexOf('version/') + 8);
userAgent = userAgent.substring(0, userAgent.indexOf(' '));
$.browser.version = userAgent;
$.browser.safari = false;
browserName = 'Safari';
version = $.browser.version;
displayPop= parseInt(version) < safariversion ? true : false;
} else if ($.browser.mozilla) {
browserName = 'Mozilla';
var ver = userAgent.split('firefox/');
version = ver[1];
displayPop= parseFloat(version) < firefoxversion ? true : false;
} else if ($.browser.msie) {
browserName = 'IE';
version = $.browser.version;
displayPop= parseInt(version) < miseversion ? true : false;
}
if (displayPop) {
alert(browserName); // current browser name
alert(version);// current version of the browser
$('h1').html('Lower version!'); // write your code
}
});