Created
April 20, 2011 18:18
-
-
Save oliverbarnes/932207 to your computer and use it in GitHub Desktop.
trying to save navigation when clicking on final node's link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" charset="utf-8"> | |
$(function() { | |
{% if item.root? %} | |
$.jStorage.flush(); | |
{% endif %} | |
$('#nav').columnview({ | |
preview: function(element) { | |
$.jStorage.flush(); | |
if($.browser.msie) { | |
active1 = $("li").find(".active").first().text(); | |
active2 = $("li").find(".active").last().text(); | |
$.jStorage.set('inpath1', active1 ); | |
$.jStorage.set('inpath2', active2 ); | |
} else { | |
$.jStorage.set('inpath1', $('a.inpath').first().text()); | |
$.jStorage.set('inpath2', $('a.inpath').last().text()); | |
} | |
element.click(); | |
} | |
}); | |
if($.jStorage.get('inpath1')) { | |
$("a:contains("+$.jStorage.get('inpath1')+")").click(); | |
$("a:contains("+$.jStorage.get('inpath2')+")").click(); | |
$("a:contains("+$.jStorage.get('inpath1')+")").addClass('active'); | |
$("a[href='{{ item.path }}']").addClass('active'); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment