![]() |
![]() |
||||||
|
|||||||
| Tags: accordion, spry |
![]() |
|
|||
|
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!! |
| Sponsored Links |
|
|||
|
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.onPanelTabMouseOve r = 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!!! |
|
|||
|
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); } |
|
|||
|
[q]Originally posted by: FreightGuy
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.onPanelTabMouseOve r = 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!!![/q] I know this is an old topic, but i've been trying to get this to work as was Yael_K. Thanks Freight for that source because I just couldn't find the settings for the accordian panel. Once I knew where to look I was able to paste the code and it works like a dream now. Cheers. |
|
|||
|
Very useful information. Thanks man! I was having a similar problem on a site I'm building for somebody right now. thanks.
http://www.indyonline.com |
|
|||
|
[q]Originally posted by: FreightGuy
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.onPanelTabMouseOve r = 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!!![/q] I also have the same problem, but now has solved,. Thank you for your reply ________________________________________ http://www.dogbreedss.org | http://www.dogbreedss.org/puppy-names.htm | http://dogforadoption.googlepages.com/puppys.htm |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise