Skip to content

Commit

Permalink
1.9.3 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Apr 30, 2013
1 parent 76eead4 commit 4393308
Show file tree
Hide file tree
Showing 5 changed files with 1,855 additions and 15 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<h2>About</h2>
<p><strong>Swiper</strong> - is the <strong>free and ultra lightweight</strong> mobile touch slider with hardware accelerated transitions (where supported) and amazing native behavior. It is intended to use in mobile websites, mobile web apps, and mobile native apps. Designed mostly for iOS, but also works on Android and latest Desktop browsers. <strong>Swiper</strong> is created by <a href="http://www.idangero.us">iDangero.us</a></p>
<h2>Change Log</h2>
<h3>Swiper 1.9.3 - Updated on April 30, 2013</h3>
<ul>
<li>Few important fixes including IE8 improvements</li>
<li>Updated <a href="plugins/scrollbar.php">Scrollbar</a> plugin to be compatible with IE8</li>
</ul>
<h3>Swiper 1.9.2 - Updated on April 19, 2013</h3>
<ul>
<li>New <a href="http://www.idangero.us/sliders/swiper/api.php">API</a> features:
Expand Down
39 changes: 24 additions & 15 deletions dev/idangerous.swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ var Swiper = function (selector, params, callback) {
===========================*/
_this.support = {
touch : _this.isSupportTouch(),
threeD : _this.isSupport3D()
threeD : _this.isSupport3D(),
transitions : _this.isSupportTransitions()
}
//For fallback with older versions
_this.use3D = _this.support.threeD;
Expand Down Expand Up @@ -767,7 +768,8 @@ var Swiper = function (selector, params, callback) {
_this.setTransform(x,y,0)
}

e.preventDefault();
if(event.preventDefault) event.preventDefault();
else event.returnValue = false;
return false;
}
if (_this._wheelEvent) {
Expand All @@ -794,7 +796,7 @@ var Swiper = function (selector, params, callback) {
if (_this.isTouched || params.onlyExternal) {
return false
}
if (params.preventClassNoSwiping && event.target.className.indexOf('NoSwiping') > -1) return false;
if (params.preventClassNoSwiping && event.target && event.target.className.indexOf('NoSwiping') > -1) return false;

//Check For Nested Swipers
_this.isTouched = true;
Expand Down Expand Up @@ -1020,13 +1022,6 @@ var Swiper = function (selector, params, callback) {
if ( params.onlyExternal || !_this.isTouched ) return
_this.isTouched = false

//Release inner links
if (params.preventLinks) {
setTimeout(function(){
_this.allowLinks = true;
},10)
}

//Return Grab Cursor
if (params.grabCursor) {
_this.container.style.cursor = 'move';
Expand Down Expand Up @@ -1067,8 +1062,12 @@ var Swiper = function (selector, params, callback) {
var diff = _this.positions.diff ;
var diffAbs =_this.positions.abs ;

if(diffAbs < 5) {
if(diffAbs < 5 && (_this.times.end - _this.times.start) < 300 && _this.allowLinks == false) {
_this.swipeReset()
//Release inner links
if (params.preventLinks) {
_this.allowLinks = true;
}
}

var maxPosition = wrapperSize - containerSize;
Expand Down Expand Up @@ -1308,10 +1307,16 @@ var Swiper = function (selector, params, callback) {

//Transition End Callback
if (params.onSlideChangeEnd && !_this._queueEndCallbacks) {
_this._queueEndCallbacks = true;
_this.transitionEnd(params.onSlideChangeEnd)
if(_this.support.transitions) {
_this._queueEndCallbacks = true;
_this.transitionEnd(params.onSlideChangeEnd)
}
else {
setTimeout(function(){
params.onSlideChangeEnd(_this)
},10)
}
}

}

_this.updateActiveSlide = function(position) {
Expand Down Expand Up @@ -1390,7 +1395,11 @@ Swiper.prototype = {
isSupportTouch : function() {
return ("ontouchstart" in window) || window.DocumentTouch && document instanceof DocumentTouch;
},

//Transition Support
isSupportTransitions : function(){
var div = document.createElement('div').style
return ('transition' in div) || ('WebkitTransition' in div) || ('MozTransition' in div) || ('msTransition' in div) || ('MsTransition' in div) || ('OTransition' in div);
},
// 3D Transforms Test
isSupport3D : function() {
var div = document.createElement('div');
Expand Down
Loading

0 comments on commit 4393308

Please sign in to comment.