Permalink
Browse files

fix bugs for old browsers that doesn't support width/height or opacity

  • Loading branch information...
1 parent f948201 commit 36ffe1317c160ed34f003f1cdb354e1fe5b714e6 @mask8 committed Oct 20, 2011
Showing with 14 additions and 10 deletions.
  1. +4 −2 index.html
  2. +10 −8 js/jquery.et.scroller.js
View
@@ -12,8 +12,10 @@
// Your code here
$(".scroller").etScroller({
// 'overflow': true,
- 'hscroll': true,
- 'vscroll': true
+ 'hscroll': false,
+ 'vscroll': true,
+ 'width': 400,
+ 'height': 400
});
});
</script>
View
@@ -19,7 +19,9 @@
vscroll: true,
hscroll: false,
hide: false,
- overflow: false
+ overflow: false,
+ width: null,
+ height: null
};
return this.each(function(){
@@ -40,8 +42,8 @@
// change overflow settings of this
$wrapper.css({
- 'width': $(this).width(),
- 'height': $(this).height(),
+ 'width': (settings.width) ? settings.width : $(this).width(),
+ 'height': (settings.height) ? settings.height : $(this).height(),
'position': 'relative',
'z-index': 0
});
@@ -76,7 +78,7 @@
});
if($wrapper.height() >= $content.height() || settings.overflow || !settings.vscroll) {
bar_height = $wrapper.height();
- $vbar.css({height: bar_height + "px", opacity: 0.0});
+ $vbar.css({height: bar_height + "px", 'display': 'none'});
}
$wrapper.append($vbar);
@@ -100,7 +102,7 @@
});
if($wrapper.width() >= $content.width() || settings.overflow || !settings.hscroll) {
bar_width = $wrapper.width();
- $hbar.css({width: bar_width + "px", opacity: 0.0});
+ $hbar.css({width: bar_width + "px", 'display': 'none'});
}
$wrapper.append($hbar);
@@ -239,15 +241,15 @@
vmin = -1 * $content.height() + $wrapper.height();
if($wrapper.height() >= $content.height() || settings.overflow || !settings.vscroll) {
bar_height = $wrapper.height();
- $vbar.css({'height': bar_height + "px", opacity: 0.0});
+ $vbar.css({'height': bar_height + "px", 'display': 'none'});
}
bar_width = $wrapper.width() * $wrapper.width() / $content.width();
$hbar.css({ "width": bar_width + "px" });
hmin = -1 * $content.width() + $wrapper.width();
if($wrapper.width() >= $content.width() || settings.overflow || !settings.hscroll) {
bar_width = $wrapper.width();
- $hbar.css({'width': bar_width + "px", opacity: 0.0});
+ $hbar.css({'width': bar_width + "px", 'display': 'none'});
}
});
@@ -388,4 +390,4 @@
}
};
-})( jQuery );
+})( jQuery );

0 comments on commit 36ffe13

Please sign in to comment.