Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created July 6, 2016 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/c4c9d36061eed451370c06199473443a to your computer and use it in GitHub Desktop.
Save joshfeck/c4c9d36061eed451370c06199473443a to your computer and use it in GitHub Desktop.
Divi theme JavaScript fix for Event Espresso MER cart button.
// around line 739 of Divi's custom.js file, you'll find this:
$( 'a[href*="#"]:not([href="#"])' ).click( function() {
var $this_link = $( this ),
has_closest_smooth_scroll_disabled = $this_link.closest( '.et_smooth_scroll_disabled' ).length,
has_closest_woocommerce_tabs = ( $this_link.closest( '.woocommerce-tabs' ).length && $this_link.closest( '.tabs' ).length ),
has_closest_eab_cal_link = $this_link.closest( '.eab-shortcode_calendar-navigation-link' ).length,
has_acomment_reply = $this_link.hasClass( 'acomment-reply' ),
disable_scroll = has_closest_smooth_scroll_disabled || has_closest_woocommerce_tabs || has_closest_eab_cal_link || has_acomment_reply;
// change to this:
$( 'a[href*="#"]:not([href="#"])' ).click( function() {
var $this_link = $( this ),
has_closest_smooth_scroll_disabled = $this_link.closest( '.et_smooth_scroll_disabled' ).length,
has_closest_woocommerce_tabs = ( $this_link.closest( '.woocommerce-tabs' ).length && $this_link.closest( '.tabs' ).length ),
has_closest_eab_cal_link = $this_link.closest( '.eab-shortcode_calendar-navigation-link' ).length,
has_closest_ee_cart_link = $this_link.closest( '.view-cart-lnk' ).length,
has_acomment_reply = $this_link.hasClass( 'acomment-reply' ),
disable_scroll = has_closest_smooth_scroll_disabled || has_closest_ee_cart_link || has_closest_woocommerce_tabs || has_closest_eab_cal_link || has_acomment_reply;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment