Skip to content

Instantly share code, notes, and snippets.

@carlito
carlito / checkWindowSize on resize
Last active August 29, 2015 13:58
Check for window size on load and on window resize (with a delay).
var id, delay = 5000;
var checkWindowSize = function() {
var windowSize = {
width: $(window).width(),
height: $(window).height()
}
};
function onWindowResizeEnd(){
@carlito
carlito / inputValueToggle.js
Created April 3, 2014 08:23
Input value toggle with jQuery
$.each($('input'), function(){
var v = $(this).val();
$(this).focus(function(){
var current_v = $(this).val();
if(current_v==v) {
$(this)
.val('')
.addClass('active');
}
});
@carlito
carlito / drupal-mobile-pagination.css
Last active December 15, 2015 07:48
Some (jQuery dependent) JS and CSS to change the default Drupal pagination to prev/next buttons and a dropdown. Created for a mobile theme.
/*
* CSS to hide everything from the
* pagination except prev/next buttons.
*/
.search-results.node-results {
margin-bottom: 0;
border-bottom: 2px solid #ccc;
box-shadow: 0 4px 6px #ddd;
}