Permalink
Browse files

* pointing to google cdn jQuery 1.5 now with local jQuery 1.5 fallback.

* [WIP] added demo of horizontal scrolling
  • Loading branch information...
kswedberg committed Feb 17, 2011
1 parent ba432e6 commit 435ff80597dbacd1c98923e824e5a843bf9028fc
Showing with 46 additions and 5 deletions.
  1. +30 −5 demo/index.html
  2. +16 −0 lib/jquery.js
View
@@ -10,13 +10,22 @@
}
.scrollme {
height: 100px;
+ width: 180px;
overflow: auto;
padding-left: 8px;
border: 1px solid #999;
}
+ .scrollme-x {
+ width: 400px;
+ }
+ .scrollme-x div,
+ .scrollme-x p {
+ float: left;
+ width: 180px;
+ }
</style>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
- <script>!window.jQuery && document.write(unescape('%3Cscript src="/lib/jquery.js"%3E%3C/script%3E'));</script>
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.js"></script>
+ <script>!window.jQuery && document.write(unescape('%3Cscript src="../lib/jquery.js"%3E%3C/script%3E'));</script>
<script src="../jquery.smooth-scroll.js" type="text/javascript"></script>
<script type="text/javascript">
@@ -38,6 +47,15 @@
});
return false;
});
+ $('button.scrollhorz').click(function() {
+ $.smoothScroll({
+ direction: 'left',
+ scrollElement: $('div.scrollme'),
+ scrollTarget: '.horiz'
+ });
+ return false;
+ });
+
});
</script>
@@ -53,10 +71,17 @@
<li><a href="#p5">p5</a></li>
</ul>
- <button class="scrollsomething">Scroll the next div</button>
+ <button class="scrollsomething">Scroll vertically</button>
+ <button class="scrollhorz">Scroll horizontally</button>
+
<div class="scrollme">
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
- </p>
+ <div class="scrollme-x">
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+ </p>
+ <div class="horiz">
+ You found me by scrolling horizontally. nice job!
+ </div>
+ </div>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
View

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit 435ff80

Please sign in to comment.