dyrobin
Forum Replies Created
-
Forum: Plugins
In reply to: [Sticky Menu & Sticky Header] Make the sticky element full widthHi,
Maybe the “stacked” word makes you confusing. So, I put three pictures here to make it clear and I think you should understand what the feature I request.
original nav menu
your plugin does
my suggestion featureAnyway, you are the author and have the right to evaluate this feature. I am totally OK with current version and sure I can do some changes by myself 🙂
Regards,
Forum: Plugins
In reply to: [Sticky Menu & Sticky Header] Make the sticky element full widthHi,
thanks for your reply. I understand the idea that the plugin will retain the original width of the sticky element. However, when I tried your plugin to a navigation menu, I had a problem of “stacked” effect because that navigation menu is not full width originally and when it is sticky the left and right margins are occupied by following full-width content. This problem can be solved by setting the navigation menu to full width when sticky. And basically that’s why I suggest such a feature to make a toggle option to extend the sticky element to full-width.
Sorry that I can’t provide you my website as an example but I think this feature might be useful for those navigation menus that are not full-width. Maybe I am the only one who asks this feature but it doesn’t mean other guys don’t want it.
As for the onScroll event, yes, it will be triggered many many many times a second but the handler in this case should be quite simple (just to check the boundary then fix or unfix, right?) and most of the time the handler doesn’t need to do anything except checking. In contrast, the setInterval function here is invoked 100 times a second but each time it is invoked, it seems that a lot of code are executed. So the problem is which one is bigger? 2000×1 or 100×50? And obviously animation is different as the handler might be complex and that is why animation is suggested to use requestAnimationFrame. Following links talked something about this:
http://www.html5rocks.com/en/tutorials/speed/animations/
https://css-tricks.com/using-requestanimationframe/
Anyway, I agree with you that this is not a critical issue at the moment 🙂Regards,