Styling Thumbnails after Changing Variant

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jsmirnow
    Mini Mivite

    • Sep 2015
    • 20

    #1

    Styling Thumbnails after Changing Variant

    I have a custom product page where I have styled the thumbnails with a hover border on the list elements using Jquery. Works great until I change a variant (pick a color, etc). After changing the variant, the thumbnails are rebuilt for the new variant and the hover effect stops working.

    I have subscribed to the variant_changed event to reapply the jquery hover effect, however variant_changed fires before the DOM is modified with the new thumbnails.

    Any ideas on how to run a function after the DOM has been modified when a variant changes?
  • jsmirnow
    Mini Mivite

    • Sep 2015
    • 20

    #2
    Re: Styling Thumbnails after Changing Variant

    Figured it out.

    Add the below to custom.js for JS_PROD:

    ImageMachine.prototype.oninitialize = function (data) {
    this.Initialize(data);
    //Your custom stuff here...
    }

    Comment

    Working...
    X