Use ths jsp filter to remove extra elements that are automatically inserted in by default
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() { | |
$('a[href*=#]:not([href=#])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
$('html,body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); | |
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
var a = " example "; console.log(a.trim()); // output: "example" | |
//IE Polyfill | |
if (!String.prototype.trim) { String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, ''); }; } |
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() { | |
function div(a, b) { | |
return a / b; | |
} | |
function divBy5(x) { | |
return div(x, 5); | |
} | |
window.divBy5 = divBy5; |
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
body { | |
font-family: Arial, sans-serif; | |
padding: 20px; | |
text-align: center; | |
} | |
button { | |
margin-bottom: 40px; | |
} |
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
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { | |
/* IE10+ specific styles go here */ | |
} |
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
var dom = (function($) { | |
var _counter = 0; | |
function generateId(){ | |
return "customId" + _counter++; | |
} | |
function create(tagName, id) { | |
var el = document.createElement(tagName); |
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
/** | |
* CSS3 tabbed interface | |
* - based on http://www.sitepoint.com/css3-tabs-using-target-selector/ | |
* - 1st tab is LAST in markup: | |
* - so it can be styled as active on page load | |
* - use combination of :target and ~ to override when another tab is clicked | |
*/ | |
body { | |
font: 62.5%/1.5 Georgia,serif; | |
margin: 10em 0 0; |