jQuery fans blog and community sharing news, plugins, video tutorials, demos and more.

Touch Swipe Function Debounce Script

Speed is everything on touch devices. Calling a function when a touch swipe has completed instead of calling it multiple times… For example you may use it to update some navigation based on a finger swipe. FYI I’m using hammer.js to capture the touch events…

Continue reading →

JavaScript Snippet Force a DOM Element Redraw/Repaint

JavaScript code snippet to force a DOM element redraw/repaint. A bit hacky but useful as a last resort. var element = document.getElementById(’id’); var n = document.createTextNode(’ ‘); var disp = element.style.display;  // don’t worry about previous display style element.appendChild(n); element.style.display = ‘none’; setTimeout(function(){    …

Continue reading →

Get Client IP Using jQuery

A few code snippets to Get Client IP Using JavaScript/jQuery. 1. One way This one gives you longitude/latitude and timezone. Try it! $(document).ready( function() { $.getJSON( "http://smart-ip.net/geoip-json?callback=?", function(data){ alert( data.host); } );}); Returns: ?( {    source: "smart-ip.net",    host: "",    lang: "en",  …

Continue reading →

jQuery refresh page on browser resize

Basic code snippet to refresh the page on a browser resize using JavaScript. //refresh page on browser resize $(window).bind(’resize’, function(e) {   console.log(’window resized..’);   this.location.reload(false); /* false to get page from cache */   /* true to fetch page from server */ }); If…

Continue reading →

Output word by word of paragraph using jQuery

jQuery code snippet which outputs each word in a sentence at a specified interval. You can change the speed at which is outputs by the speed parameter in milliseconds. You can view the demo or load the code in jsfiddle below. DEMO jQuery $(document).ready(function ()…

Continue reading →

Page 3 of 50 1 2 3 4 5 ... Last →
scroll to top