WordPress, by default, will add the width and height attributes to image elements. These attributes will override CSS width and height properties. Making images with these dimension attributes responsive is a bit of a hassle, or in some cases cannot be done at all. Strip Image Dimension Attributes from Inserted Images Stripping out the image…… Read More
Category: jQuery
Automatically Download PDFs via jQuery
Have you ever wanted to have a link to a resource, such as a PDF file, and have that resource be automatically downloaded when the link is clicked? All you need to do is add a download attribute to your link HTML. <a href=”/resources/newsletter.pdf” download>Newsletter</a> But wait, the download attribute isn’t supported across all the…… Read More
Open External Links in a New Window
A common practice with web links is to make sure that links to other websites open in a new tab. At the same time, all links to other pages on the same site should open in the current browser tab. It is important to understand why this approach is a best practice. For starters, visitors…… Read More
Disable Links with an Empty href Attribute
Occasionally, there is a need to create a link that doesn’t actually go anywhere. A great example of this is a top-level menu item that displays a drop-down of sub-menu items. In this use case, you simply want a menu item that serves as a container for other menu items, but isn’t meant to take…… Read More