Jquery

Currently reading:
Jquery

mehstg

GPS Multijet 1.9 Orange
Joined
Aug 26, 2008
Messages
1,665
Points
288
Location
North London
More geekyness!

Trying to implement JQuery on a website I am working on, basically, the whole front page is one big accordion and clicking on the various bars opens and closes the sections. Like this example.

This all works perfectly, but like all javascript, if the user clicks the back button, it does not keep a history of the changes.

I understand there are plugins like Jquery History and Jquery-BBQ that I can use, but I cannot work out how to implement them!

The code I wrote for my accordion is as follows:
Code:
  $(document).ready(function(){
	$(".bodyText").hide(); 				   
  	$("a h3").click(function(){
  	if($(this).is('.active')) {
		$(this).toggleClass("active");
  		$(this).parent().parent().next(".bodyText").slideToggle();
  		return false;
  	} else {
  		$(".bodyText:visible").slideUp("slow"); 
		$("h3.active").removeClass("active"); 
		$(this).toggleClass("active");
  		$(this).parent().parent().next(".bodyText").slideToggle();
  		return false;
		}
	});
});

Pretty simple code really, and does what I want. Just want to get some kind of history, so if the user uses the back button, they nav back through the site.

Any ideas?
 
Little bit of progress on this. Have got the hashing working using JQuery UI and know it now has something to do with The accordion navigation.

Anyone on here have any clue how to implement the navigationFilter option in the Jquery UI Accordion??

Here is the test site I am working on http://preview.tinyurl.com/ygtnmj6

P
 
Last edited:
Back
Top