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
$('input, textarea').focus(function(){ | |
$(this).data('placeholder',$(this).attr('placeholder')); | |
$(this).attr('placeholder',''); | |
}); | |
$('input, textarea').blur(function(){ | |
$(this).attr('placeholder',$(this).data('placeholder')); | |
}); |
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
$(".only_english_chars").on("keypress", function(event) { | |
var englishAlphabetAndWhiteSpace = /[A-Za-z ]/g; | |
var key = String.fromCharCode(event.which); | |
if (event.keyCode == 8 || event.keyCode == 37 || event.keyCode == 39 || englishAlphabetAndWhiteSpace.test(key)) { | |
return true; | |
} | |
return false; | |
}); | |
$('.only_enlgish_chars').on("paste",function(e) { | |
e.preventDefault(); |
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
function getUrlVars() { | |
var vars = {}; | |
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { | |
vars[key] = value; | |
}); | |
return vars; | |
} | |
$(document).ready(function() { | |
//read get variable | |
var activate = getUrlVars()['activate']; |
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
$('.go-top').click(function() { | |
$('html, body').animate({scrollTop: 0}, 300); | |
}); | |
//go-top | |
$(window).scroll(function() { | |
if ($(window).scrollTop() > 150) { | |
$('.go-top').fadeIn(); | |
} else { | |
$('.go-top').fadeOut(); |
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^="#"]').click(function(){ | |
var target = $(this).attr('href'); | |
$('html, body').animate({scrollTop: $(target).offset().top}, 500); | |
return 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
.map iframe, | |
.map ymaps { | |
pointer-events: none; | |
} |
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
function initMap() { | |
var mapCanvas = document.getElementById('map'); | |
var myLatlng = new google.maps.LatLng(43.235501, 13.633698); | |
var mapOptions = { | |
center: myLatlng, | |
zoom: 17, | |
disableDefaultUI: true, | |
styles: [ | |
{ | |
featureType: "all", |
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
//input[name=name] only letters and spaces | |
$('input[name=name]').on('keydown', function(e) { | |
var key = event.keyCode; | |
return ((key >= 65 && key <= 90) || key === 8 || key === 32); | |
}); |
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
//only-numbers | |
$(".only-numbers").on("keypress", function (evt) { | |
var charCode = (evt.which) ? evt.which : event.keyCode; | |
return !(charCode > 31 && (charCode < 48 || charCode > 57)); | |
}); |
OlderNewer