Skip to content

Commit 3e4c5a6

Browse files
committed
New autoplay option
1 parent 3bc0ffd commit 3e4c5a6

File tree

6 files changed

+40
-11
lines changed

6 files changed

+40
-11
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jQuery easy ticker is a news ticker like plugin which scrolls a list infinitely.
1414
* The speed of the transition can be changed.
1515
* Controls can be added in order to Play/pause or move the list up and down.
1616
* Cross browser support.
17-
* Light weight (2.82 KB - minified).
17+
* Light weight (2.86 KB - minified).
1818

1919
## Usage
2020

@@ -68,6 +68,7 @@ $(document).ready(function(){
6868
height: 'auto',
6969
visible: 0,
7070
mousePause: true,
71+
autoplay: true,
7172
controls: {
7273
up: '',
7374
down: '',

dist/jquery.easy-ticker.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

easyticker.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"vertical",
1515
"easing"
1616
],
17-
"version": "3.4.0",
17+
"version": "3.5.0",
1818
"author": {
1919
"name": "Aakash Chakravarthy",
2020
"url": "https://www.aakashweb.com/"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery-easy-ticker",
3-
"version": "3.4.0",
3+
"version": "3.5.0",
44
"description": "jQuery easy ticker plugin allows to add news ticker like scroll to list elements",
55
"scripts": {
66
"build": "grunt"

src/jquery.easy-ticker.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery - Easy Ticker plugin - v3.4.0
2+
* jQuery - Easy Ticker plugin - v3.5.0
33
* https://www.aakashweb.com/
44
* Copyright 2022, Aakash Chakravarthy
55
* Released under the MIT License.
@@ -16,6 +16,7 @@
1616
height: 'auto',
1717
visible: 0,
1818
mousePause: true,
19+
autoplay: true,
1920
controls: {
2021
up: '',
2122
down: '',
@@ -92,6 +93,15 @@
9293

9394
function start(){
9495

96+
if(!s.opts.autoplay)
97+
return;
98+
99+
startForce();
100+
101+
}
102+
103+
function startForce(){
104+
95105
if(s.timer != 0)
96106
return;
97107

@@ -100,8 +110,9 @@
100110
}, s.opts.interval);
101111

102112
$(s.opts.controls.toggle).addClass('et-run').html(s.opts.controls.stopText);
113+
103114
}
104-
115+
105116
function stop(){
106117
clearInterval(s.timer);
107118
s.timer = 0;
@@ -244,7 +255,7 @@
244255
return {
245256
up: function(){ moveDir('up'); },
246257
down: function(){ moveDir('down'); },
247-
start: start,
258+
start: startForce,
248259
stop: stop,
249260
options: s.opts
250261
};

test/test.html

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<title>jQuery Easy ticker test</title>
66
</head>
7-
<body>
7+
<body style="max-width: 700px">
88

99
<script src="../node_modules/jquery/dist/jquery.min.js" type="text/javascript"></script>
1010
<script type="text/javascript" src="../src/jquery.easy-ticker.js"></script>
@@ -20,6 +20,7 @@
2020
height: 'auto',
2121
visible: 1,
2222
mousePause: true,
23+
autoplay: true,
2324
controls: {
2425
up: '.up',
2526
down: '.down',
@@ -88,6 +89,12 @@
8889
$('.t5Wrap').fadeToggle();
8990
});
9091

92+
var ticker6 = $('.myTicker6').easyTicker({
93+
interval: 2000,
94+
visible: 3,
95+
autoplay: false
96+
});
97+
9198
});
9299
</script>
93100

@@ -152,7 +159,7 @@ <h2>Ticker 5</h2>
152159
<button class="t5Btn">Toggle</button>
153160
<div class="t5Wrap">
154161
<div class="myTicker5">
155-
<ul style="width:100px">
162+
<ul>
156163
<li>Triangles can be made easily using CSS also without any images. This trick requires only div tags and some CSS works. To get this trick, just use the code below.</li>
157164
<li>List 2</li>
158165
<li>This trick requires only div tags and some CSS works. To get this trick, just use the code below. This trick requires only div tags and some CSS works. To get this trick, just use the code below.</li>
@@ -163,7 +170,17 @@ <h2>Ticker 5</h2>
163170
</div>
164171
</div>
165172

166-
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam cum, non in dolore doloribus voluptatibus ullam nisi deleniti facere reprehenderit animi, magnam quod necessitatibus illo reiciendis beatae expedita labore qui!</p>
173+
<h2>Ticker 6</h2>
174+
<div class="myTicker6">
175+
<ul>
176+
<li>Triangles can be made easily using CSS also without any images. This trick requires only div tags and some CSS works. To get this trick, just use the code below.</li>
177+
<li>List 2</li>
178+
<li>This trick requires only div tags and some CSS works. To get this trick, just use the code below. This trick requires only div tags and some CSS works. To get this trick, just use the code below.</li>
179+
<li>List 4</li>
180+
<li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum porro quod nostrum est quos, rerum possimus voluptas exercitationem atque, vel fugiat nobis praesentium animi iure necessitatibus reprehenderit. Pariatur, tempore officia.</li>
181+
<li class="last-item">Hey... Triangles can be made easily using CSS also without any images. This trick requires only div tags and some CSS works. To get this trick, just use the code below.</li>
182+
</ul>
183+
</div>
167184

168185
<style>
169186
.myTicker{

0 commit comments

Comments
 (0)