Skip to content

Commit

Permalink
Improving demo/readme
Browse files Browse the repository at this point in the history
  • Loading branch information
padolsey committed Mar 18, 2010
1 parent 2bc8e5e commit b931fa5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Plugins so far:
* [Pulse][2]
* [Macro][3]
* [Cross domain Ajax][4]
* [Sort][5]


###Licenses
Expand All @@ -24,4 +25,5 @@ Unless otherwise specified within any of the plugins, you can assume the followi
[1]: http://james.padolsey.com
[2]: http://github.com/jamespadolsey/jQuery-Plugins/tree/master/pulse/
[3]: http://github.com/jamespadolsey/jQuery-Plugins/tree/master/macro/
[4]: http://github.com/jamespadolsey/jQuery-Plugins/tree/master/cross-domain-ajax/
[4]: http://github.com/jamespadolsey/jQuery-Plugins/tree/master/cross-domain-ajax/
[5]: http://github.com/jamespadolsey/jQuery-Plugins/tree/master/sort/
6 changes: 6 additions & 0 deletions sort/_notes/dwsync.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="demo.html" server="qd9.co.uk/httpdocs/projects/" local="129134292007989799" remote="129134045400000000" />
<file name="jquery.sort.js" server="qd9.co.uk/httpdocs/projects/" local="129134281012000865" remote="129134045400000000" />
<file name="README.md" server="qd9.co.uk/httpdocs/projects/" local="129134284681990776" remote="129134045400000000" />
</dwsync>
17 changes: 17 additions & 0 deletions sort/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,21 @@ <h1>Demo</h1>
</tbody>
</table>

<button>Click to sort the list below</button>

<ul>
<li>Lamborghini</li>
<li>Farrari</li>
<li>Masarati</li>
<li>Aston Martin</li>
<li>Porche</li>
</ul>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="jquery.sort.js"></script>
<script>
var th = jQuery('th'),
li = jQuery('li'),
inverse = false;

th.click(function(){
Expand Down Expand Up @@ -81,6 +92,12 @@ <h1>Demo</h1>
inverse = !inverse;

});

$('button').click(function(){
li.sort(function(a, b){
return $(a).text() > $(b).text() ? 1 : -1;
});
});
</script>

</body>
Expand Down

0 comments on commit b931fa5

Please sign in to comment.