Skip to content

Commit 5c76df5

Browse files
phloxicjQuery Tools
authored andcommitted
scrollable: remove unused variables in click event for size: 2
time and fn variables do not belong to the scope of the click event's function. Add test page for size 2 scrollable, including test. Fixes http://flowplayer.org/forum/8/31650.
1 parent 9630c93 commit 5c76df5

File tree

2 files changed

+78
-1
lines changed

2 files changed

+78
-1
lines changed

src/scrollable/scrollable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
if (i == index) { i--; }
289289
self.getItems().removeClass(klass);
290290
item.addClass(klass);
291-
return self.seekTo(i, time, fn);
291+
return self.seekTo(i);
292292
}
293293

294294
if (!item.hasClass(klass)) {

test/scrollable/size2.html

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
<script src="../jquery-1.3.2.js"></script>
3+
<script src="../../src/scrollable/scrollable.js"></script>
4+
<script src="../../src/scrollable/scrollable.circular.js"></script>
5+
<script src="../../src/scrollable/scrollable.navigator.js"></script>
6+
<script src="../../src/scrollable/scrollable.autoscroll.js"></script>
7+
8+
<script src="../../src/util/util.history.js"></script>
9+
<script src="../../src/util/util.mousewheel.js"></script>
10+
11+
<link rel="stylesheet" type="text/css" href="style.css"/>
12+
13+
<style>
14+
div.cloned {
15+
background-color:#ffc !important;
16+
}
17+
18+
div.active {
19+
background-color:#66d !important;
20+
}
21+
22+
.disabled {
23+
visibility:hidden;
24+
}
25+
</style>
26+
27+
<script>
28+
$(function() {
29+
var root = $("div.scrollable").scrollable({
30+
size: 2,
31+
mousewheel: true
32+
33+
}).navigator({idPrefix: 'a', history: true});
34+
35+
36+
// setup api
37+
window.api = root.scrollable();
38+
39+
// test http://flowplayer.org/forum/8/31650
40+
$("button:eq(0)").click(function () {
41+
try {
42+
window.api.click(0);
43+
$(this).text("success");
44+
} catch (err) {
45+
$(this).text("failed");
46+
}
47+
});
48+
});
49+
</script>
50+
51+
52+
<div class="navi"></div>
53+
54+
55+
<a class="prev">prev</a>
56+
<a class="prevPage">prevPage</a>
57+
58+
<div class="scrollable" style="width:260px">
59+
60+
<div class="items">
61+
<div>0</div> <div>1</div> <div>2</div> <div>3</div> <div>4</div>
62+
<div>5</div> <div>6</div> <div>7</div> <div>8</div> <div>9</div>
63+
<div>10</div> <div>11</div> <div>12</div> <div>13</div> <div>14</div>
64+
</div>
65+
66+
</div>
67+
68+
<a class="next">next</a>
69+
<a class="nextPage">nextPage</a>
70+
71+
<br clear="all" />
72+
73+
<h4>Test 8/31650</h4>
74+
75+
<p>
76+
<button type="button">test click</button>
77+
</p>

0 commit comments

Comments
 (0)