Permalink
Browse files

ie detection without jQuery

  • Loading branch information...
1 parent 72ab82d commit c270116e5e5fcb045ecaac5196a7efb0cc3d0cc1 @bbarakaci committed Feb 2, 2013
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/fixto.js
View
16 src/fixto.js
@@ -125,7 +125,14 @@ var fixto = (function ($, window, document) {
computedStyle:computedStyle
};
}());
-
+
+ // Dirty business
+ var ie = navigator.appName === 'Microsoft Internet Explorer';
+ var ieversion;
+
+ if(ie){
+ ieversion = parseFloat(navigator.appVersion.split("MSIE")[1]);
+ }
// Class FixToContainer
@@ -168,7 +175,7 @@ var fixto = (function ($, window, document) {
},
// at ie8 maybe only in vm window resize event fires everytime an element is resized.
- _toresize : $.support.leadingWhitespace ? document.documentElement : window,
+ _toresize : ieversion===8 ? document.documentElement : window,
// Returns the total outerHeight of the elements passed to mind option. Will return 0 if none.
_mindtop: function () {
@@ -339,9 +346,8 @@ var fixto = (function ($, window, document) {
No support for touch devices and ie lt 8
*/
var touch = !!('ontouchstart' in window);
- var ielt8 = !$.support.leadingWhitespace;
-
- if(touch || ielt8){
+
+ if(touch || ieversion<8){
fixTo = function(){
return 'not supported';
};

0 comments on commit c270116

Please sign in to comment.