Check if jQuery is Loaded Script

Glenn Blog Leave a Comment

jQuery is a fast, small, and feature-rich JavaScript library and we use it extensively across all our sites. A key factor when developing is that the library is correctly loaded, but also that it’s only loaded once. To check if jQuery is already loaded into your platform (i.e. WordPress has it by default) then you can use this Javascript snippet:- …

jQuery Responsive Equal Height Method

Glenn Blog Leave a Comment

There are so many methods too get a fluid equal height in jQuery, but in testing many (seriously loads) I’ve found that there’s usually a glitch and that’s often that the container doesn’t adjust on window resize. This is the best all round solution that I’ve come across to resolve this issue. In my example I’m applying it to the …

jQuery Open Link with Class in New Window jQuery Open Link with Class in New Window open in new window sm 862x378

jQuery Open Link with Class in New Window

Glenn Blog Leave a Comment

Sometimes out of the box code doesn’t open links in new windows / in window “_blank” and in these instances this small jQuery snippet will come to the rescue:- So simply add the class “external-url” to your link and it will open in a new window. Working: Slick Media WordPress Developers I find this useful for WordPress elements that you …

jQuery Clickable Div Based on Internal Link

Glenn Uncategorized Leave a Comment

If you want a div to be clickable based on a standard HTML internal link, within that div, then use this jQuery snippet (requires jQuery Library):- The code will rattle through the parent div looking for links and will then add the link it to that div. Useful for components that require clickable divs with custom defined structured content (portfolio …

Change Placeholder Text jQuery and CSS styling

Glenn Glenn's Blog Leave a Comment

A quick snippet to change the placeholder text of an input field:- You can also achieve placeholder custom style with CSS on supported browsers Pagelines Users If you are using Pagelines DMS then you can also use the following hook in your themes functions.php file to customise the search and change the placeholder text:-      

Responsive jQuery Layout

Glenn Glenn's Blog Leave a Comment

When we created our client site VP Speech Language we wanted to make the home page differ to the other pages in layout, but to reunify it in mobile view – in this case the menu needed to shift from the middle of the home page back to the top in mobile view. There are ways of doing this in CSS but adding …

Black and White CSS Hover

Glenn Glenn's Blog Leave a Comment

We’ve used various versions of jQuery and HTML5 to get Back and White images with hover. Here’s our preferred solution {here we are adding greyscale to ‘.item img’ so replace with your own element} … the problem with many of these approaches is that they break your preferred code structure. CSS would be a more elegant way of doing it …