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
// Allows sliders to be dynamically initiated more easily | |
// Adds validation for min and max number input boxes | |
// Minimizes code if many sliders are on a page | |
var searchSlider = { | |
init: function(selector, range_min, range_max){ | |
var input_min = $(selector).parents('.slider-wrapper').find('.min'), | |
input_max = $(selector).parents('.slider-wrapper').find('.max'); |
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 shortenLink(){ | |
var screenWidth = $(window).width(); | |
var f = function(){ | |
var linkTextURL = $(this).text(); | |
if (screenWidth < 450) linkTextURL = linkTextURL.substring(0,40) + "..."; | |
$(this).text(linkTextURL); | |
} | |
$('a.resultLink').each(f); |
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
//this 100% isnt accurate due to android browser unreliably reporting width.. use at your own risk | |
// Note - requires Modernizr touch detection build | |
if (Modernizr.touch && window.innerWidth < 768) { | |
// mobile user (if a touch screen and the window is smaller than tablet sized) | |
alert('Mobile Phone'); | |
} | |
else { | |
alert('Desktop or Tablet Browser'); |
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
$("body").click(function(e){ | |
if(e.target.className !== "foo"){ | |
$(".foo").hide(); | |
} | |
} | |
); |
NewerOlder