how do I switch the portfolio thumbnail action from “hover” to “click”?
(So it changes the big image on click, instead of on hover – while keeping the effect when you do hover on the thumbnail.)
so close to perfect, thank you!!
Try following – open up wp-contentthemesenfoldjsshortcodes.js and replace
gallery.on('mouseenter','.avia-gallery-thumb a', function()
{
var _self = this;
big_prev.attr('data-onclick', _self.getAttribute("data-onclick"));
big_prev.height(big_prev.height());
big_prev.attr('href', _self.href)
var newImg = _self.getAttribute("data-prev-img"),
oldImg = big_prev.find('img').attr('src');
if(newImg != oldImg)
{
var next_img = new Image();
next_img.src = newImg;
big_prev.stop().animate({opacity:0}, function()
{
big_prev.html(next_img);
big_prev.animate({opacity:1});
});
}
});
with
gallery.on('click','.avia-gallery-thumb a', function()
{
var _self = this;
big_prev.attr('data-onclick', _self.getAttribute("data-onclick"));
big_prev.height(big_prev.height());
big_prev.attr('href', _self.href)
var newImg = _self.getAttribute("data-prev-img"),
oldImg = big_prev.find('img').attr('src');
if(newImg != oldImg)
{
var next_img = new Image();
next_img.src = newImg;
big_prev.stop().animate({opacity:0}, function()
{
big_prev.html(next_img);
big_prev.animate({opacity:1});
});
}
return false;
});
tried it, doesn’t quite work http://douglasmoyerarchitect.com/dev/portfolio-item/town-lane/
tested with all plugins disabled…
figured it out, change to mousedown not click