Skip to content

Instantly share code, notes, and snippets.

View jplhomer's full-sized avatar

Josh Larson jplhomer

View GitHub Profile
@jplhomer
jplhomer / pageslide.min.js
Created September 9, 2013 17:44
A small fork of srobbin's jquery-pageslide (https://github.com/srobbin/jquery-pageslide) to enable the touch event in the main container, enabling the menu to be toggled by an off-menu touch on mobile.
/*
* jQuery pageSlide
* Version 2.0
* EDITED BY @jplhomer to enable the toggling of the menu by touching the main content area.
* http://srobbin.com/jquery-pageslide/
*
* jQuery Javascript plugin which slides a webpage over to reveal an additional interaction pane.
*
* Copyright (c) 2011 Scott Robbin (srobbin.com)
* Dual licensed under the MIT and GPL licenses.
@jplhomer
jplhomer / woocommerce-alter-cart-total.php
Last active July 10, 2021 01:53
Programmatically alter the WooCommerce cart discount total (and apply a new discount) before it's calculated through the woocommerce_calculate_totals hook. Add this code to your Wordpress functions.php file.
<?php
/**
* Programmatically alter the WooCommerce cart discount total (and apply a new discount) before it's calculated
* through the woocommerce_calculate_totals hook.
*
* For example, if you want to apply an arbitrary discount after a certain number of products in the cart,
* you can loop through that number and increment it as needed.
*
* In this example, I increment the discount by $8.85 after every 15 products added to the cart.
*
@jplhomer
jplhomer / Fixed-Nav-HoverIntent-Example.markdown
Created August 22, 2013 22:25
A CodePen by Joshua P. Larson.

Fixed Nav HoverIntent Example

I ended up building a funky bottom-fixed nav which had a full-width submenu. This example includes the "slide-up" CSS3 animation as well as the inclusion of the HoverIntent plugin.

A Pen by Joshua P. Larson on CodePen.

License.