Closed motorcityadam closed 9 years ago
+1 for a merge
+1
Thanks for the contribution, I'm reviewing all the changes now.
+1 on the display:none
detection, I thought it was related to that, but glad to see someone else has confirmed.
Might I suggest a different solution, a trick I learned from jQuery and element dimensions. When you ask for the offsetWidth
on an element and it is display:none
, you'll get 0. When you ask jQuery for the $('#...').width()
on a display:none
object, it temp sets the display to block
, grabs the width and sets it back to none
. This would all happen between the redraw interval, so the user won't even notice.
Maybe you could do something similar instead of polling.
I finally merged most of the changes proposed in this pull request, and changed the polling with a CSS animation to detect when the element is visible as discussed with @thomassuckow.
Added a bower.json to allow me to use grunt-bower-task to include this project as a dependency on one of my projects. I had to increase the version to 0.5.2 to repackage the release for Bower. This Closes #3.