|
From: | Ian Barton |
Subject: | [Orgmode] Some Javascript Adventures |
Date: | Tue, 12 May 2009 12:42:54 +0100 |
User-agent: | Thunderbird 2.0.0.21 (X11/20090409) |
However, the jQuery library seems to have excellent documentation. More importantly using jQuery seems to mostly protect you from trying to debug your code on lots of different browsers, since the jQuery author has already done it for you.
After some experiments I cam up with the following snippets which toggle the visibility of DONE tasks and also timestamps. Hope someone finds them useful!
Ian.<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" > <!--/*--><![CDATA[/*><!--*/ $(document).ready(function(){ $('#toggletimestamp').click(function() { $('span.timestamp-wrapper').toggle(); }); $('#toggledone').click(function() { myParent = $("span.done").parent(); myParent.toggle(); }); }); /*]]>*/--> </script> You can set up a buttons to call these functions: <input type="submit" name="toggletimestamp" value="Toggle Time Stamp" id="toggletimestamp" /> <input type="submit" name="toggledone" value="Toggle Done" id="toggledone" />
[Prev in Thread] | Current Thread | [Next in Thread] |