Blog

Posts in "Code Snippet" category

A super simple jquery lightbox

This snippet will create a very lightweight simple light box effect for you to use on images.

Add this code inside your document ready function after loading jQuery.

$('.lb').click(function(e){     e.preventDefault();     ...

see full post
tags:

How to verify an email address with jQuery

This snippet will verify an email address is correct using a regular expression.

Add this code inside your document ready function.

function isValidEmailAddress(emailAddress) {     var pattern = /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ ...

see full post
tags:

How to remove content WordPress adds to header and footer

This snippet will remove ALL the code WordPress adds to the head and foot of your code, such as styles, scripts and other meta tags.

Just add the code below to ...

see full post
tags:

How to stop scrolling when cursor is over an element with jQuery

Use the snippet below to remove the ability to page scroll with the mouse when the cursor is over an element with jQuery.

$.fn.isolatedScroll = function() {     this.bind('mousewheel DOMMouseScroll', function ...

see full post
tags:

How to remove parts of the WordPress admin Header

Add the snippet below to your themes functions.php file to remove parts of the WordPress admin Header

function remove_admin_bar_links() {     global $wp_admin_bar;     $wp_admin_bar->remove_menu('wp-logo'); // Remove the WordPress logo ...

see full post
tags:

welcome to the eudemonics blog ...

you can find posts about the things i've been working on, useful code snippets and articles relating to my interests.

comments can be left at the bottom of each post, if you wish to contribute to an article please get in touch.

Blog Categories

Blog Tags