This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a[href$="#"]').on("click", function(e) { | |
e.preventDefault(); // to remove # from address bar | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
//Description: Some mobile browsers autocapitalize inputs, This applies the autocapitalize='off' option to all inputs with a specific class, so it won't autocapitalize them. | |
//Author: Andrew Nesbitt | |
$(document).ready(function(){ | |
// disable autocapitalize on .url, .email fields | |
unautocapitalize('url'); | |
unautocapitalize('email'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
// Hide any image that 404 | |
$('img').bind('error', function () { | |
$(this).hide(); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(document).ready(function () { | |
$(function () { | |
var settings = $.data($(‘form’)[0], ‘validator’).settings; | |
settings.ignore = “” | |
settings.onkeyup = false; | |
settings.onfocusout = false; | |
}); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Time = Total Time in Seconds | |
// Minutes and seconds | |
var mins = ~~(time / 60); | |
var secs = time % 60; | |
// Hours, minutes and seconds | |
var hrs = ~~ (time / 3600); | |
var mins = ~~ ((time % 3600) / 60); | |
var secs = time % 60; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* jquery.requiredfields.js | |
* Copyright (c) 2012 Adrian D. Alvarez | |
* Licensed under the MIT, GPL licenses. | |
*/ | |
(function ($) { | |
var requiredlegend = "Essential information is marked with an asterisk (<abbr title='Required' class='required'>*</abbr>)"; | |
var requiredlegendset = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Unobtrusive JavaScript: Remove Unwanted Link Border Outlines | |
// http://www.mikesmullin.com/2006/06/16/removing-the-dotted-outline-from-focused-links | |
var runOnLoad = []; | |
window.onload = function () { | |
'use strict'; | |
for (var i = 0; i < runOnLoad.length; i++) { | |
runOnLoad[i](); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery plugin: PutCursorAtEnd 1.0 | |
// http://plugins.jquery.com/project/PutCursorAtEnd | |
// by teedyay | |
// | |
// Puts the cursor at the end of a textbox/ textarea | |
// codesnippet: 691e18b1-f4f9-41b4-8fe8-bc8ee51b48d4 | |
(function($) | |
{ | |
jQuery.fn.putCursorAtEnd = function() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/a/3855394 | |
var qs = (function(a) { | |
if (a == "") return {}; | |
var b = {}; | |
for (var i = 0; i < a.length; ++i) | |
{ | |
var p=a[i].split('='); | |
if (p.length != 2) continue; | |
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); | |
} |
OlderNewer