Skip to content

Instantly share code, notes, and snippets.

@tsulli
tsulli / tableToRWD.js
Created January 18, 2018 14:35
Script that creates THEAD out of THs in first row if one is not present (or creates a blank one) for jQuery DataTables
/*
x20170622 - sullivtm - 22 June 2017
Uses SpryMedia's Datatables jQuery Plug-in.
TO USE: Put this on a page with a plain table and add class="RWDtable" to the table tag. If a thead is not present,
one will be created out of the first row of THs or a blank one will be added so SpryMedia's DataTable plug-in works.
Do not use colspan for table cells.
Supports multiple tables on one page.
*/
$(document).ready(function(){
$('table.RWDtable').each(function() {
@tsulli
tsulli / gist:e42d63500f5bc0c1aacb
Last active January 18, 2018 23:41
jQuery Loader for Slideshow on Large Screens, Single Image on Small Screens
// jQuery script to pull images and load bxslider slideshow for large screen, load single image (no slideshow) for small screens and old IE
// Tested on Chrome, FF, IE11, iOS, Surface
function slideshow_loader() {
var dir = "slideshow/";
var large_width = "780";
var small_width = "530";
var $img;
if ($(window).width() > 568) {