Skip navigation
Currently Being Moderated

spry collapsible panels close on mouseout

Jun 30, 2011 7:21 AM

Hi all,

 

Been googling this problem but can't seem to find the answer; HOW can I make the panels on this site: http://www.opentechniek.nl close if the mouse is moving out of the panel? They open on click and that is just fine, but I really need them to close on mouseout.

 

Suggestions are welcome...

 
Replies
  • Currently Being Moderated
    Jun 30, 2011 7:42 AM   in reply to arnospaansen

    Here's spry accordion example page. There's an example to programatically open/close panels. http://labs.adobe.com/technologies/spry/samples/accordion/AccordionSam ple.html#ProgramaticOpenAndClose

     

     

    If you look at the code there's a onclick trigger for the buttons. Change trigger to onmouseout and place the trigger in the accordion body instead of the button.

     

    best,

    Shocker

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 30, 2011 9:56 PM   in reply to arnospaansen
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <link href="http://labs.adobe.com/technologies/spry/widgets/collapsiblepanel/SpryCollapsiblePanel.css" rel="stylesheet">
    </head>
    
    <body>
    <div id="CollapsiblePanelGroup" class="CollapsiblePanelGroup">
         <div class="CollapsiblePanel">
        <div class="CollapsiblePanelTab" tabindex="0">Panel1</div>
        <div class="CollapsiblePanelContent">Content 1</div>
      </div>  
         <div class="CollapsiblePanel">
        <div class="CollapsiblePanelTab" tabindex="0">Panel2</div>
        <div class="CollapsiblePanelContent">Content 2</div>
      </div>  
         <div class="CollapsiblePanel">
        <div class="CollapsiblePanelTab" tabindex="0">Panel3</div>
        <div class="CollapsiblePanelContent">Content 3</div>
      </div>  
         <div class="CollapsiblePanel">
        <div class="CollapsiblePanelTab" tabindex="0">Panel4</div>
        <div class="CollapsiblePanelContent">Content 4</div>
      </div>  
         <div class="CollapsiblePanel">
        <div class="CollapsiblePanelTab" tabindex="0">Panel5</div>
        <div class="CollapsiblePanelContent">Content 5</div>
      </div>  
         <div class="CollapsiblePanel">
        <div class="CollapsiblePanelTab" tabindex="0">Panel6</div>
        <div class="CollapsiblePanelContent">Content 6</div>
      </div>  
    </div>
    <script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryDOMUtils.js"></script>
    <script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryCollapsiblePanel.js"></script>
    <script>
    function setPanelOpenClose(e) {
         cpg.closeAllPanels();
         return false;
    }
    Spry.$$(".CollapsiblePanelContent").addEventListener("mouseout", setPanelOpenClose, false);
    var cpg = new Spry.Widget.CollapsiblePanelGroup("CollapsiblePanelGroup", { contentIsOpen: false });
    </script>
    </body>
    </html>

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 1, 2011 1:22 AM   in reply to arnospaansen

    Copy and paste the suggested code in a new document and view that in a browser. If it works, I would suggest that you adept your code to suit.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 13, 2012 8:09 AM   in reply to Ben Pleysier

    Gramps, you are amazing.  That said, your code (even as is) only mostly works.

     

    Try this:

    • open a panel. Look at content. Mouseout along sides or bottom of open Content panel.  -- OK, this works!

    • open a panel, but keep cursor in TAB. Look at content. Now mouseout UPWARDS (leave TAB without ever hovering over Content). -- Tab will not close.

     

    Any way around this?  THANKS!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points