Better Way to Resize Video using jQuery

I have already written a little jQuery snippet to resize videos but I came across an article by Chris Coyier with an approach that I thought worked a lot better. Though I did add a few tweaks to it:

Now your videos will only be resized if they are larger than the parent container. In the instance above, I have set the parent container to the paragraph tag surrounding the video (in WordPress, a paragraph tag is automatically added to each paragraph). If your site uses a different container, you can easily change that one line to the tag, ID or class of your parent container.
newWidth = el.parents( '.class-name' ).width(),
Search

Popular Posts

Small Biz Website Tips Newsletter

Stay up to date with the latest marketing, sales, and service tips and news.

Small Biz Website Tips Newsletter

Stay up to date with the latest marketing, sales, and service tips and news.