Conditional "restore on mouse leave"

Feb 01, 2013

I am creating a tabs menu, where each tab has its own layer.  I'd like the layers visible when the user hovers over their associated tabs, which works fine.  When a user actually clicks on a tab, I'd like that layer to STAY visible, even if the cursor leaves.  If the cursor hovers over another tab, temporarily show that tab's layer, but then back to the 'clicked' layer when the cursor leaves again.  Basically, if a tab has been clicked, that tab's layer should be the default layer to 'restore' to when not actively hovering over something.  

I have tried this with "restore on mouse leave" turned on and off, and with the Hover trigger above and below the Click trigger.  Somehow it's just not working!  Anyone have suggestions?  I feel like this should be a natural way for tabs to function.

7 Replies
Erik Erickson

I ran into the same issue and was looking for a solution when I came across this thread. I ended up tinkering around with it some more and found a work around.

To start, I think the problem is a timing issue. I probably won't describe the technical aspects of this accurately, but here's how I conceptualize it. The mouse hover over trigger basically starts a set of instructions (like a script). This set will end with restoring the original state once the mouse leaves. If the user clicks the tab, this set of instructions doesn't stop (unfortunately). So, when the user clicks the tab, the triggers for clicking are executed, but then once the mouse leaves that tab (stops to hover over) it finishes the other set of instructions and returns to the original state it started at. (I hope that made sense). 

I found a work around to make the hover feature customizable, but it may not work in all situations. 

I first deselected restore on mouse leave. 

I then created a shape that was slightly larger than the tab (or tabs). I made this shape invisible with no fill and no outline and placed it right underneath the tabs I wanted the user to click. 

I added a set of hover mouse over triggers to this tab with the conditions I wanted to restore the tabs to the state I wanted them to be. In effect this created a mouse leave or mouse not hover the tab (or other object) trigger. 

I hope that helps for future reference!

This discussion is closed. You can start a new discussion or contact Articulate Support.