Skip to content

Instantly share code, notes, and snippets.

View abrjagad's full-sized avatar

Abraham Jagadeesh abrjagad

View GitHub Profile
@abrjagad
abrjagad / Jquery Validation
Created February 11, 2014 08:02
Common Jquery validation plugin Method
//Global validation message
jQuery.extend(jQuery.validator.messages, {
required: "تعبئة هذا الحقل إجباري"
});
// New Method like email; this one to check Emirates Id
jQuery.validator.addMethod('emiratesId', function (value) {
return /^\d{3}-?\d{4}-?\d{7}-?\d{1}$/.test(value);
}, 'Please enter a valid Emirates ID number');
// common initialisation
@abrjagad
abrjagad / Close Mobile Menu on click outside
Created February 11, 2014 07:57
Close Mobile Menu on click outside, used when doing responsive page, for small screens
$(".small-menu").click(function (event) {
event.stopPropagation();
$(".fixed-nav-header").fadeToggle();
})
$(document).click(function () {
if ($(".fixed-nav-header").is(":visible")) {
$(".fixed-nav-header").fadeOut();
}
});