Skip to content

Instantly share code, notes, and snippets.

View danny-englander's full-sized avatar

Danny Englander (he/him) danny-englander

View GitHub Profile
@danny-englander
danny-englander / Custom.js
Created October 31, 2012 19:41
Unique Colorbox classes for better theming
$(document).ready(function (){
// element-1 and element-2 are hrefs that trigger any given colorbox
$(".element-1").click(function() {
$('#colorbox').addClass("cb1").removeClass('cb2'); //add a custom class to #colorbox
});
$(".element-2").click(function() {
@danny-englander
danny-englander / drupal-sf-touch.js
Created September 13, 2012 00:38 — forked from dougalcampbell/drupal-sf-touch.js
Make Drupal Superfish dropdowns touch-friendly (for Drupal 7)
// adapted from: http://snippets.webaware.com.au/snippets/make-css-drop-down-menus-work-on-touch-devices/
// forked from https://gist.github.com/3351233
(function ($) {
//add new drupal 7 code
Drupal.behaviors.touchdevice_dropdowns = {
attach:function (context, settings) {
//end drupal calls
@danny-englander
danny-englander / jquery.responsive-classes.js
Created September 13, 2012 00:16
JQuery Responsive Classes
/*
* Inspired by:
* http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery
*
* This script is ideal for getting specific class depending on device width
* for enhanced theming. Media queries are fine in most cases but sometimes
* you want to target a specific JQuery call based on width. This will work
* for that. Be sure to put it first in your script file. Note that you could
* also target the body class instead of 'html' as well.
* Modify as needed