Tuesday, February 12th, 2019
Drop this in to your console in dev tools and all elements with position: absolute
will render with a border.
var absElements = [];
$("*").css("position", function(i, pos){
if(pos==="absolute") absElements.push(this);
});
$(absElements).css({border:"5px solid red"});
Tags: attribute, CSS, elements, find, jQuery, propert, search by property, search for
Posted in CSS, jQuery | No Comments »
Wednesday, August 29th, 2018
/* Remove all spaces in tel: href links so click to call works */
$('a[href^="tel:"]').attr('href', function(_,v){
return v.replace(/\(0\)|\s+/g,'')
});
Tags: Click to call, javascript, jQuery, Links, Phone, Tel, Telephone
Posted in jQuery | No Comments »
Wednesday, June 14th, 2017
See the Pen Cross-browser horizontal mousewheel scroll by Matt Seymour (@mwseymour) on CodePen.
Tags: Cross browser, Horizonal, Mouse wheel, scroll
Posted in jQuery | No Comments »
Friday, June 3rd, 2016
Tags: javascript, jQuery, Repository, scroll, Vanilla
Posted in jQuery | 1 Comment »
Monday, April 11th, 2016
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 800);
return false;
}
}
});
});
Tags: Anchor, Bind, Click, Event, Link, scroll
Posted in jQuery | No Comments »
Friday, December 11th, 2015
A jQuery method to remove text orphans from any element you declare. Light-weight and easy to use!
$(function() {
unorphan($('p, h1, h2, h3, h4'))
});
Tags: jQuery, orphans, Text
Posted in jQuery | No Comments »
Friday, June 5th, 2015
Tags: Columns, Containers, Divs, EqualHeights, jQuery
Posted in jQuery | No Comments »