This technique adds a specific class to your target element so you have the advantage of controlling the styling through CSS only (and avoiding inline styling). UPDATE: Here's another option if you don't want to make use of any other third-party libraries. trigger('resize') to run on page load instead. Of course, you can attach your resize handler outside of the document ready handler if you want. This will cause your resize handler to trigger on window resize and on document ready. $(window).resize(myResizeFunction).trigger('resize') JavaScript/JQuery: $(window).resize how to fire AFTER the resize is completed? If you don't have underscore or lodash, you can implement a similar solution yourself: This isn't used as often with resize events, but it's worth being aware of. It "throttles" how often the code is called. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |