jQuery Set Image TITLE from ALT Tag

This is a super-useful jQuery Script that gets the Image Title from the ALT Tag if no title is set with a fall-back to the image src. jQuery(document).ready(function($) { $(“img:not([title])”).each(function() { if($(this).attr(“alt”) != ”) $(this).parent().attr(“title”, $(this).attr(“alt”)); else $(this).parent().attr(“title”, $(this).attr(“src”)); }); }); view rawjQuery Set Image TITLE from ALT Tag hosted with ❤ by GitHub Benefits of getting the Image Title …

Enable Cross-Origin Resource Sharing with CORS Anywhere

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served. There may be legitimate reasons for another website to block access to content via an iframe or jQuery load function and this is apparent when you get a response …

CSS Colour Tint

Use the following CSS in this order to achieve a pure CSS colour Tint: – .tint { filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(180deg); } view rawCSS Colour Tint hosted with ❤ by GitHub To achieve your CSS colour tint you only need to change the hue-rotate value. Works on parent elements and their children.

Element height always the same as Width

This is a very useful snippet for ensuring that your element height (div, img etc) is always the same as the width. An example case could be a circular div that you want to ensure maintains a set aspect ratio so that it is not squashed or elongated. There are a few examples of how to achieve this below, but …

Auto populate Webflow form from URL parameter uppercase remove %20

This code allows you to auto-populate a Webflow form on a different page with a URL parameter. It is an extension of an original code posted on the Webflow Forum that covers form email fields, text fields as well as select dropdowns and textarea. The URL parameters may be passed as lowercase variables such as ?name=glenn (becoming ‘Glenn’) and then subsequent …

301 Domain Redirect

The 301 domain redirect is the best way to ensure that you keep SEO when moving from one domain name to another like olddomain.com to newdomain.com. The correct way to achieve this is by editing the .htaccess file of the old site on your server. The .htaccess file sits in your site’s root folder (directly under yourdomainname.com) and can be …

Slick Carousel Fade In on Load

You don’t need any Javascript/jQuery to Fade in the Slick Carousel on Load as this can be acheived with just a few lines of CSS.  /* .slick-slider */ .slick-slider-class { opacity: 0; } /* Slider initialised class */ .slick-initialized { opacity:1; transition:opacity .3s ease-in; } view rawSlick Carousel Fade In on Load hosted with ❤ by GitHub Initially you need …

CSS Target all mobile devices

If you are looking to make a universal CSS rule for all mobile devices then use the following CSS media query:- @media (pointer:coarse) { /* custom css for “touch targets” */ } @media (hover: none) { /* custom css for devices where the primary input mechanism cannot hover at all or cannot conveniently hover } @media (hover:none), (hover:on-demand) { /* …