Team:UT-Tokyo/Templates/BeginContent
From 2011.igem.org
(Difference between revisions)
Line 321: | Line 321: | ||
(function(UT_Tokyo) { | (function(UT_Tokyo) { | ||
+ | // code stolen from http://neave.com/ | ||
+ | var ua = navigator.userAgent.toLowerCase(); | ||
+ | |||
+ | UT_Tokyo.isIE6 = /msie [1-6]\./.test(ua); | ||
+ | UT_Tokyo.isIE7 = /msie 7\./.test(ua); | ||
+ | UT_Tokyo.isIE8 = /msie 8\./.test(ua); | ||
+ | if (UT_Tokyo.isIE6 * UT_Tokyo.isIE8) { | ||
+ | UT_Tokyo.isIE6 = false; | ||
+ | } | ||
+ | UT_Tokyo.isIE9 = /msie 9\./.test(ua); | ||
+ | UT_Tokyo.isIE7or8 = UT_Tokyo.isIE7 || UT_Tokyo.isIE8; | ||
+ | UT_Tokyo.isChrome = /chrome/.test(ua); | ||
+ | UT_Tokyo.isFF = /firefox/.test(ua); | ||
+ | UT_Tokyo.isOpera = !!((/opera/.test(ua)) * (/opera mini/.test(ua))); | ||
+ | UT_Tokyo.isMac = (/mac os/i).test(ua); | ||
+ | UT_Tokyo.isAndroid = /android/.test(ua); | ||
+ | UT_Tokyo.isiPad = /iPad/.test(navigator.platform); | ||
+ | UT_Tokyo.isTouch = !!('ontouchstart' in window); | ||
+ | UT_Tokyo.hasStorage = !!(!!(window.sessionStorage) * !!(sessionStorage.getItem)); | ||
+ | UT_Tokyo.hasHistory = !!(!!(window.history) && !!(history.pushState)); | ||
+ | UT_Tokyo.hasCanvas = !!window.CanvasRenderingContext2D; | ||
+ | UT_Tokyo.hasWebGL = !!window.WebGLRenderingContext; | ||
UT_Tokyo.useAjaxLoading = !!(document.location.href.match('Team:UT-Tokyo/?$')); | UT_Tokyo.useAjaxLoading = !!(document.location.href.match('Team:UT-Tokyo/?$')); | ||
Line 423: | Line 445: | ||
}); | }); | ||
- | + | if (UT_Tokyo.useAjaxLoading) { | |
- | $(' | + | $('#menu ul li a').click(function(e) { |
alert(this.attr('href')); | alert(this.attr('href')); | ||
UT_Tokyo.transit(this.attr('href')); | UT_Tokyo.transit(this.attr('href')); | ||
Line 430: | Line 452: | ||
return false; | return false; | ||
}); | }); | ||
- | + | } | |
UT_Tokyo.initMenu('\ | UT_Tokyo.initMenu('\ |
Revision as of 08:17, 27 August 2011