This file contains hidden or 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<!-- Favicons Start --> | |
<!-- In case image.ico --> | |
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /> |
This file contains hidden or 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
<!-- Check if jQuery already exists --> | |
<script type="text/javascript"> | |
(function() { | |
if(window.jQuery === undefined) | |
{ | |
document.write('<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"><\/script>'); | |
} | |
else | |
{ | |
jQuery = window.jQuery; |
This file contains hidden or 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
<!-- Favicons --> | |
<!-- In case image.ico --> | |
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /> | |
<!-- In case image.png --> | |
<link rel="shortcut icon" type="image/png" href="favicon.png" /> | |
<!-- Apple Devices --> | |
<link rel="apple-touch-icon" href="60x60.png"> |
This file contains hidden or 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 Scroll to Top */ | |
function scrollTop() { | |
$(window).scroll(function() { | |
$(window).scrollTop() > 50 ? $('#top').fadeIn('slow') : $('#top').fadeOut('slow'); | |
}); | |
$('a[href=#top]').click(function() { | |
$('html, body').animate({scrollTop:0}, 'slow'); | |
return false; | |
}); |
This file contains hidden or 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
/* If browser doesn't recognize attr placeholder change inputs value on focus/blur with the placeholder value */ | |
/* Works for jQuery version > 1.9 were $.browser was deprecated and cannot be used anymore */ | |
function iePlaceholder() { | |
if(document.createElement("input").placeholder == undefined) | |
{ | |
$(':input').each(function() { | |
var input = $(this); | |
$(input).val(input.attr('placeholder')); |
This file contains hidden or 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
/* | |
|-------------------------------------------------------------------------- | |
| XHTML, HTML4, HTML5 Reset CSS | |
|-------------------------------------------------------------------------- | |
*/ | |
a, | |
abbr, | |
acronym, | |
address, |
This file contains hidden or 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 Validate Emails with Regex */ | |
function validateEmail(Email) { | |
var pattern = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; | |
return $.trim(Email).match(pattern) ? true : false; | |
} |
This file contains hidden or 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 Validate Strings with Regex */ | |
function validateStrings(string) { | |
var pattern = /^[0-9a-zA-Z@_-]+$/; | |
return $.trim(string).match(pattern) ? true : false; | |
} |
This file contains hidden or 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
//Create a single custom object | |
var object = { | |
attribute1: 'value1', | |
attribute2: 'value2', | |
method1: function() { | |
return this.attribute1 + ' ' + this.attribute2; | |
} | |
}; |
This file contains hidden or 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
//Create a custom object for multiple instances | |
function object(attribute1, attribute2) { | |
this.attribute1 = attribute1; | |
this.attribute2 = attribute2; | |
this.method1 = function() { | |
return this.attribute1 + ' ' + this.attribute2; | |
}; | |
} |
OlderNewer