Skip to content

Instantly share code, notes, and snippets.

@NateJLewis
Created August 31, 2015 16:36
Show Gist options
  • Save NateJLewis/72e5493476882e4a4ea4 to your computer and use it in GitHub Desktop.
Save NateJLewis/72e5493476882e4a4ea4 to your computer and use it in GitHub Desktop.
$(".color_swatch")
.mouseenter(function() {
var imgBgColor = $(this).find("input.color_checkbox").val();
console.log(imgBgColor);
$(".single_product .front_wrap").addClass("swatch_'+imgBgColor+'");
})
.mouseleave(function() {
var imgBgColor = $(this).find("input.color_checkbox").val();
console.log(imgBgColor);
$(".single_product .front_wrap").removeClass("swatch_'+imgBgColor+'");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment