Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Dashboard/JS/CSS: Force "hover" update

Dashboard/JS/CSS: Force "hover" update
Thread Tools
DayLateDon
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Oct 26, 2006, 10:25 PM
 
Hello ...

I have a widget with a collection of tab buttons with a CSS class "tab-off" and a ":hover" variant. Likewise, there's a "tab-on" class with a ":hover" variant. (Actually, I don't intend to use "tab-on:hover", but it's helping me track the situation at hand.) My javascript properly swaps out the classes across the tab family when any one of them is clicked.

However, sometimes the tabs get "stuck" in hover-mode, probably because the widget resizes for different tab selections and the buttons move out from under the mouse instead of the mouse doing the moving. The issue has two aspects.

(1) When I click Tab A, the mouse is hovering over it, so it displays "tab-on:hover" attributes, even as the window resizes and pulls the button out from under the mouse. The widget thinks the mouse is still hovering over Tab A. (If I subsequently pass the mouse across the button, it will get unstuck and show non-hovering attributes.)

(2) When I then click Tab B, it suffers the same problem as in (1), but also, Tab A displays "tab-off:hover" attributes. The widget thinks the mouse is still hovering over Tab B *and* Tab A. Sometimes even Tab C gets stuck this way. (Again, I can get them unstuck with a pass of the mouse.)

How can I tell the widget to update the hover states automatically after the resize action?
     
Catfish_Man
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
Oct 27, 2006, 05:48 PM
 
This *might* work:
Get the offsetTop property of the element from js during the resize; I believe this forces a relayout, which might update the display.
     
DayLateDon  (op)
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Oct 28, 2006, 10:38 AM
 
I'm moving this discussion to the "Web Developer" forum, where I should have posted my message in the first place.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:02 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,