Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: steverhoades/jquerytools
base: 717be9f1fd
...
head fork: steverhoades/jquerytools
compare: ab23323130
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 23, 2012
@steverhoades Fixed issue with circular scrolling where clones weren't getting
appended to proper itemWrap when conf.item set to anything but the
default value.

Change-Id: I306ce6430bd23c1f51165f4560958f5a835a7680
869bbd3
@steverhoades Adding unit tests.
Change-Id: Ia7796c52cf7a0a1421c034e29a2b3dff84285b01
ab23323
View
5 src/scrollable/scrollable.js
@@ -231,8 +231,9 @@
// Clone the first conf.size items and append them to the container, and clone
// the last conf.size items and prepend them to the container.
//
- var cloned2 = self.getItems().slice(0,self.getSize()).clone().addClass(conf.clonedClass).appendTo(itemWrap),
- cloned1 = self.getItems().slice(-self.getSize()).clone().addClass(conf.clonedClass).prependTo(itemWrap);
+ var items = self.getItems();
+ var cloned2 = items.slice(0,self.getSize()).clone().addClass(conf.clonedClass).appendTo(items.parent()),
+ cloned1 = items.slice(-self.getSize()).clone().addClass(conf.clonedClass).prependTo(items.parent());
self.onBeforeSeek(function(e, i, time) {
View
77 test/scrollable/circular.html
@@ -12,9 +12,7 @@
size: 3,
circular: true
}).navigator();
-});
-$(function() {
$("#scrollable-auto").scrollable({
size: 3,
circular: true
@@ -22,12 +20,33 @@
autoplay: true,
interval: 1000
});
+
+ $("#scrollable-auto2").scrollable({
+ easing: 'linear',
+ size: 1,
+ circular: true,
+ speed: 3000
+ }).navigator().autoscroll({
+ autoplay: true,
+ interval: 0
+ });
+
+ $("#scrollable-auto3").scrollable({
+ easing: 'linear',
+ size: 1,
+ circular: true,
+ speed: 3000,
+ item: " ul:first > *"
+ }).navigator().autoscroll({
+ autoplay: true,
+ interval: 0
+ });
});
</script>
<div>
-
+ <h2>3 Steps</h2>
<a class="prev">prev</a>
<div id="scrollable" class="scrollable" style="width:390px">
@@ -50,7 +69,7 @@
</div>
<div>
-
+ <h2>Autoscroll 3 Steps</h2>
<a class="prev">prev</a>
<div id="scrollable-auto" class="scrollable" style="width:390px">
@@ -71,3 +90,53 @@
<a class="next">next</a>
</div>
+
+
+<div>
+ <h2>Autoscroll 1 Step</h2>
+ <a class="prev">prev</a>
+
+ <div id="scrollable-auto2" class="scrollable" style="width:390px">
+
+ <div class="items">
+ <div>0</div>
+ <div>1</div>
+ <div>2</div>
+ <div>3</div>
+ <div>4</div>
+ <div>5</div>
+ <div>6</div>
+ <div>7</div>
+ </div>
+
+ </div>
+
+ <a class="next">next</a>
+
+</div>
+
+
+<div>
+ <h2>Scrolling with item config option</h2>
+ <a class="prev">prev</a>
+
+ <div id="scrollable-auto3" class="scrollable" style="width:390px">
+
+ <div class="items">
+ <ul>
+ <li>0</li>
+ <li>1</li>
+ <li>2</li>
+ <li>3</li>
+ <li>4</li>
+ <li>5</li>
+ <li>6</li>
+ <li>7</li>
+ </ul>
+ </div>
+
+ </div>
+
+ <a class="next">next</a>
+
+</div>
View
19 test/scrollable/style.css
@@ -51,6 +51,25 @@
background-color:yellow;
}
+ul {
+ list-style: none;
+ padding: 0;
+ margin: 0;'
+}
+li {
+ text-align:center;
+ width:110px;
+ padding:25px 0px;
+ font-size:30px;
+ font-family: 'bitstream vera sans';
+ border:1px outset #ccc;
+ background-color: #efefef;
+ margin-right: 20px;
+ float:left;
+ -moz-border-radius:5px;
+ border-radius:5px;
+}
+
/* custom style */
body {
padding:50px 100px;

No commit comments for this range

Something went wrong with that request. Please try again.