Skip to main content
Participant
October 9, 2007
Question

spry accordion

  • October 9, 2007
  • 17 replies
  • 1891 views
Hi
I can't understand how to get the accordion to open a tab on mouse over. It just opens now when it's clicked.
I found a lot of information on how to change the color of the text in css, though! I wish there was more information about the java script.
-Thanks!!
This topic is closed to new replies. Start a new post to keep the conversation going.

17 replies

September 5, 2008
Good question.
Known Participant
August 24, 2008
I had been looking for 2 hours for this answer thanks guys.
Participant
August 4, 2008
great tips. i will fix the bug!
Participant
July 23, 2008
As far as Vista goes, I wouldn't see why it wouldn't. It's really the browser that makes a difference, and when I posted I believe that I tested it with IE 3.0 - 7.0 and Firefox 1 - 3 beta 1. Those were on XP SP2. Haven't really messed with it since.
Participating Frequently
July 26, 2008
Thanks for help


Texas holdem tips
Participant
May 31, 2008
FreightGuy , thank you! You found a pretty nice solution!


http://seoanalytic.com
TareeInternet
Participant
May 23, 2008
Hmm i couldn't seem to get it to work.

Edit: Sometimes i wonder how i manage to inhale and exhale oxygen on a daily basis...

I missed the final }; tags, it's working perfectly thank you very much!!
Participant
February 28, 2008
You can actually accomplish this by finding these three lines in the javascript and changing them as shown:

Spry.Widget.Accordion.addEventListener(tab, "mouseover", function(e) { return self.onPanelTabClick(e, panel); }, false);

Spry.Widget.Accordion.addEventListener(tab, "click", function(e) { return self.onPanelTabMouseOver(e, panel); }, false);

Spry.Widget.Accordion.addEventListener(tab, "mouseout", function(e) { return self.onPanelTabMouseOut(e, panel); }, false);
}
Participant
May 19, 2008
Thanks dude, you are freakin awesome. I've been looking for about a week trying to find how to do this.
Participant
October 26, 2007
After i posted, i decided to go back and check out a few more things, and solved the mystery. In your SpryAccordion.js file, fine the section that says:
Spry.Widget.Accordion.prototype.onPanelClick = function(panel)
{
// if (this.enableKeyboardNavigation)
// this.element.focus();
if (panel != this.currentPanel)
this.openPanel(panel);
this.focus();
};

This is the code to open the accordion panel when you click on it. What we're going to do is copy this part of the code:
if (panel != this.currentPanel)
this.openPanel(panel);
this.focus();

And then find the section for mouseover, which is up towards the top, and paste it after the current code...it should look like this after we get done:
Spry.Widget.Accordion.prototype.onPanelTabMouseOver = function(panel)
{
if (panel)
this.addClassName(this.getPanelTab(panel), this.hoverClass);
if (panel != this.currentPanel)
this.openPanel(panel);
this.focus();
};

And there you have it. Save your file and go have some fun!!!
Participant
May 4, 2008
Thanks FreightGuy, it worked perfectly, tried the other though it just stuck.

been looking for this for a while now, am happy now!

blessed
Participant
October 26, 2007
I'm also looking for this same answer. I've tried a few different things, but to no avail.