Updating haccordion.js to work with newer jquery
I've been using the plugin called haccordion (
http://letmehaveblog.blogspot.com/)
My original page with the working plugin (and jquery 1.2.3)
My test page:
Once I go above about jQuery 1.3 the plugin stops working like it should. I'm no hardcore programmer and having a hard time figuring out what the issue could be. I was hoping someone might be able to point me in the right direction right off - I'm guessing something was deprecated or changed around v 1.4 of jQuery.
The haccordion code is:
- // SeViR Simple Horizontal Accordion @2007
- // http://letmehaveblog.blogspot.com
- jQuery.fn.extend({
- haccordion: function(params){
- var jQ = jQuery;
- var params = jQ.extend({
- speed: 500,
- headerclass: "accheader",
- contentclass: "acccontent",
- event: "click",
- contentwidth: 350
- },params);
- return this.each(function(){
- this.opened = jQ("."+params.contentclass,this).filter(".visible").prev();
-
- jQ("."+params.headerclass+" a",this).bind(params.event,function(){
- var p = jQ(this).parent().parent()[0];
- p.addClass("notice");
- if (p.opened != "undefined"){
- jQ(p.opened).next("div."+params.contentclass).animate({
- width: "0px"
- },params.speed);
- }
- p.opened = jQ(this).parent();
- jQ(p.opened).next("div."+params.contentclass).animate({
- width: params.contentwidth + "px",
- display: "visible"
- }, params.speed);
- return false;
- });
- });
- }
- });