Posts Tagged ‘jquery’
Timed Delay callback function
$(document).ready(function() { window.setTimeout(function() { // do something }, 1000); });
Read MoreWant to remove a certain word(s)?
$(document).ready(function() { var el = $(‘#id’); el.html(el.html().replace(/word/ig, “”)); });
Read MoreCenter an element in the center of your screen.
$(document).ready(function() { jQuery.fn.center = function() { this.css(“position”, “absolute”); this.css(“top”, ($(window).height() – this.height()) / 2 + $(window).scrollTop() + “px”); this.css(“left”, ($(window).width() – this.width()) / 2 + $(window).scrollLeft() + “px”); return this; } $(“#id”).center(); });
Read MoreGet the mouse cursor x and y axis
$(document).ready(function() { $().mousemove(function(e){ $(‘#XY’).html(“X Axis : ” + e.pageX + ” | Y Axis ” + e.pageY); }); });
Read More