just a little help...not too much
Hello, this is my first post here at the forum as I am still relatively new to using jquery. I just have small problem with what I am working on at the moment.
http://www.unf.edu/~n00181631/adv_web/project02/
From the link above I have the global nav on the left in the green box that is using the accordion script that has been customized. I currently have the about section opened up, however, I would only like for it to be opened when one of its sublinks (mission statement, chairs letter, and student learning goals) are visited to indicate that the user is directly in the about section. However, I would like for it to be closed on all the other pages. (Note: only the homepage and the about section and its sublinks are able to be visited).
-
$(document).ready(function() {
$('ul#accordion ul').hide();
$('ul#accordion a.about').click(function() {
$(this).css('outline','none');
if($(this).parent().hasClass('current')) {
$(this).siblings('ul').slideUp('slow',function() {
$(this).parent().removeClass('current');
/*$.scrollTo('#accordion',1000);*/ <!-- use for page scrolling when link is clicked -->
});
} else {
$('ul#accordion li.current ul').slideUp('slow',function() {
$(this).parent().removeClass('current');
});
$(this).siblings('ul').slideToggle('slow',function() {
$(this).parent().toggleClass('current');
});
/*$.scrollTo('#accordion',1000);*/ <!-- use for page scrolling when link is clicked -->
}
return false;
});
});
$(document).ready(function() {
$('ul#about').show();
$('ul#accordion a.about-selected').click(function() {
$(this).css('outline','none');
if($(this).parent().hasClass('current')) {
$(this).siblings('ul').slideUp('slow',function() {
$(this).parent().removeClass('current');
});
} else {
$('ul#accordion li.current ul').slideUp('slow',function() {
$(this).parent().removeClass('current');
});
$(this).siblings('ul').slideToggle('slow',function() {
$(this).parent().toggleClass('current');
});
}
return false;
});
});
Hope this helps explain it and thank you for the feedback!