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
// select checkboxes to style: $(':checkbox').styleCheckboxes(); | |
$.fn.styleCheckboxes = function() { | |
$(this).each(function(index) { | |
if (!$(this).prev("a").hasClass('check-styled')) { | |
$(this).before("<a href='#check_" + index + "' class='check-styled' id='check_" + index + "'></a>").css({ | |
position: 'absolute', | |
left: -1, | |
top: 3, | |
zIndex: -1, | |
visibility: "hidden" |
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
.hide-text { | |
text-indent: 100%; | |
white-space: nowrap; | |
overflow: hidden; | |
} |
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 for returning the user to any 'y' position in a Facebook app/tab. Uses jQuery animate, otherwise gracefully falls-back without it. | |
// Source[1]: http://stackoverflow.com/questions/7193425/how-do-you-animate-fb-canvas-scrollto | |
// Source[2]: https://developers.facebook.com/docs/reference/javascript/FB.Canvas.scrollTo/ | |
var scrollY = function (y) { | |
if (window.jQuery) { | |
FB.Canvas.getPageInfo (function (pageInfo) { | |
$({ y: pageInfo.scrollTop }) | |
.animate({ | |
y: y |
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(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(chref=d.href).replace(e.href,"").indexOf("#")&&(!/^[a-z\+\.\-]+:/i.test(chref)||chref.indexOf(e.protocol+"//"+e.host)===0)&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone"); |
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
TEST RESULTS | |
OS Supported? | |
Android 1.0—2.1 No | |
Android 2.2+ Yes | |
Blackberry 1.0—5.0 No | |
Blackberry 6.0+ Yes | |
BB Tablet OS 2.0+ Yes | |
Firefox OS 1.0 No | |
iOS 1.0—5.1.1 No | |
iOS 6.0+ Yes |
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 formatCurrency (num) { | |
aDigits = num.toFixed(2).split("."); | |
aDigits[0] = aDigits[0].split("").reverse().join("").replace(/(\d{3})(?=\d)/g, "$1,").split("").reverse().join(""); | |
return "$" + aDigits.join("."); | |
} |
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
; Sources: | |
; http://reference.sitepoint.com/css | |
; http://developer.mozilla.org/en/CSS | |
animation = "none" | |
animation-delay = "0" | |
animation-direction = "normal" | |
animation-duration = "0" | |
animation-fill-mode = "none" | |
animation-iteration-count = "1" |
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 docElem(property) { | |
var t; | |
return ((t = document.documentElement) || (t = document.body.parentNode)) && t[property] ? t : document.body; | |
} | |
// View width and height excluding any visible scrollbars | |
// http://www.highdots.com/forums/javascript/faq-topic-how-do-i-296669.html | |
// 1) document.client[Width|Height] always reliable when available, including Safari2 | |
// 2) document.documentElement.client[Width|Height] reliable in standards mode DOCTYPE, except for Safari2, Opera<9.5 | |
// 3) document.body.client[Width|Height] is gives correct result when #2 does not, except for Safari2 |
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
$('#divMonthsOuter .scrollable').scrollable({ | |
circular: false, | |
onSeek: function (event, index) { | |
var next = this.getRoot().siblings('.next'); | |
// the 6 here is the number of items showing | |
if (this.getIndex() >= this.getSize() - 6) { | |
// Disable the Next link | |
next.addClass('disabled'); | |
} else { | |
next.removeClass('disabled'); |