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
$(window).load(function() { | |
// executes when complete page is fully loaded, including all frames, objects and images | |
alert("window is loaded"); | |
}); |
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
/* elipsify any text you want to truncate. Simply use .text(cut([n])) then .append() to add in any character(s) you want after. ex: ('...')*/ | |
function cut(n) { | |
return function textCutter(i, text) { | |
var short = text.substr(0, n); | |
if (/^\S/.test(text.substr(n))) | |
return short.replace(/\s+\S*$/, ""); | |
return short; | |
}; | |
} |
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
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, | |
p, blockquote, pre, abbr, address, cite, code, del, dfn, em, | |
img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, | |
dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, | |
tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, | |
figcaption, figure, footer, header, hgroup, menu, nav, section, | |
summary, time, mark, audio, video { | |
margin:0; | |
padding:0; | |
border:0; |
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
/** | |
* Great little debuging snippet found while browsing | |
* The code adds different coloured borders to the assets depending on its level. | |
* Leave commented out if not needed. | |
*/ | |
* { outline: 2px dotted red } | |
* * { outline: 2px dotted green } | |
* * * { outline: 2px dotted orange } | |
* * * * { outline: 2px dotted blue } |
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
/** | |
* [ Preloading images is useful: Instead of loading an image when the user request it, | |
* we preload them in the background so they are ready to be displayed. Doing so in jQuery | |
* is very simple, as shown below:] | |
* Source: http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript | |
* @param {[type]} $ | |
* @return {[type]} | |
*/ | |
(function($) { | |
var cache = []; |
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
function matching_heights() { | |
var highestCol = Math.max($('').height(),$('').height()); | |
$('').height(highestCol); | |
} |
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
$(document).ready(function(){ | |
alert("success"); | |
}); |