marquee-lottery
Advanced tools
Comparing version 0.1.3 to 0.1.5
@@ -9,3 +9,3 @@ /** | ||
var $this = $(this); | ||
var roundTotal= 4,totalTime=1500,minTime=100,reduceStepTime=200,addTimeStep=50,desIndex= 0; | ||
var roundTotal= 4,maxTime=1500,minTime=100,reduceStepTime=200,addTimeStep=50,desIndex= 0; | ||
@@ -16,3 +16,3 @@ var defaultSettings = { | ||
roundTotal:roundTotal, | ||
totalTime:totalTime, | ||
maxTime:maxTime, | ||
minTime:minTime, | ||
@@ -31,10 +31,10 @@ addTimeStep:addTimeStep, | ||
return $this; | ||
}else if(settings.minTime > settings.totalTime || settings.minTime == 0){ | ||
$.error('Marquee \'minTime\' error : more than \'totalTime\' or equal 0.'); | ||
}else if(settings.minTime > settings.maxTime || settings.minTime == 0){ | ||
$.error('Marquee \'minTime\' error : more than \'maxTime\' or equal 0.'); | ||
return $this; | ||
}else if(settings.addTimeStep <= 0 || settings.addTimeStep > settings.totalTime){ | ||
$.error('Marquee \'addTimeStep\' error : less than 0 or equal 0 more than \`totalTime\`.'); | ||
}else if(settings.addTimeStep <= 0 || settings.addTimeStep > settings.maxTime){ | ||
$.error('Marquee \'addTimeStep\' error : less than 0 or equal 0 more than \`maxTime\`.'); | ||
return $this; | ||
}else if(settings.reduceTimeStep <= 0 || settings.reduceTimeStep > settings.totalTime){ | ||
$.error('Marquee \'reduceTimeStep\' error : less than 0 or equal 0 or more than \`totalTime\`.'); | ||
}else if(settings.reduceTimeStep <= 0 || settings.reduceTimeStep > settings.maxTime){ | ||
$.error('Marquee \'reduceTimeStep\' error : less than 0 or equal 0 or more than \`maxTime\`.'); | ||
return $this; | ||
@@ -57,3 +57,3 @@ }else if(settings.roundTotal <= 0){ | ||
minTime=settings.minTime,reduceStepTime=settings.reduceTimeStep,addTimeStep=settings.addTimeStep, | ||
totalTime=settings.totalTime,currentTime=totalTime; | ||
maxTime=settings.maxTime,currentTime=maxTime; | ||
//Fix the bug of the secondary of start, the `desIndex` is the active class. | ||
@@ -67,5 +67,5 @@ $(sArr[desIndex]).removeClass(settings.activeClass); | ||
} | ||
$(sArr[currentIndex]).addClass(settings.activeClass); | ||
$(sArr[currentIndex]).toggleClass(settings.activeClass); | ||
var beforeIndex = currentIndex - 1 < 0 ? sArrCount - 1 : currentIndex - 1; | ||
$(sArr[beforeIndex]).removeClass(settings.activeClass); | ||
$(sArr[beforeIndex]).toggleClass(settings.activeClass); | ||
currentIndex++; | ||
@@ -81,4 +81,4 @@ | ||
settings.finishCallback(); | ||
$this.trigger('finish-marquee-animation'); | ||
}, delayTime); | ||
return $this; | ||
} | ||
@@ -88,3 +88,3 @@ } | ||
if (currentRound > roundTotal - 1) { | ||
currentTime = currentTime + addTimeStep > totalTime ? totalTime : currentTime + addTimeStep; | ||
currentTime = currentTime + addTimeStep > maxTime ? maxTime : currentTime + addTimeStep; | ||
} else { | ||
@@ -96,2 +96,4 @@ currentTime = currentTime - reduceStepTime < minTime ? minTime : currentTime - reduceStepTime; | ||
setTimeout(callback, currentTime); | ||
$this.trigger('start-marquee-animation'); | ||
return $this; | ||
} | ||
@@ -98,0 +100,0 @@ }; |
{ | ||
"name":"MarqueeLottery", | ||
"version":"0.1.0", | ||
"version":"0.1.5", | ||
"title":"jQuery MarqueeLottery", | ||
@@ -5,0 +5,0 @@ "keywords":[ |
{ | ||
"name": "marquee-lottery", | ||
"version": "0.1.3", | ||
"version": "0.1.5", | ||
"description": "marquee-lottery is a jQuery Plugin.For conviently creating lottery activiry.", | ||
@@ -5,0 +5,0 @@ "main": "jquery-plugin.marquee-lottery.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
11600
8
146
87
0