Hi there,
So glad you're pleased with the template :)
I presume you're thinking of portfolio items / gallery. Their hover animation is triggered by cbp-caption class and lightbox with cbp-lightbox.
To disable hover animation and lightbox feature on small screens can be done easily with JS, as far as I know the PHP alone cannot detect viewport size or media queries.
With the code below you can detect if the screen is less then 992px in width (change to smaller if you like) then it will remove both caption (hover animation) and lightbox classes from every portfolio item and also prevent the image link click.
// remove hover Caption and Lightbox
if ($(window).width() < 992) {
var link = $('.cbp-item').find('a'),
caption = 'cbp-caption',
lightbox = 'cbp-lightbox';
if (link.hasClass(caption) || link.hasClass(lightbox)) {
link.removeClass(caption).removeClass(lightbox);
link.on('click', function() {
return false;
});
}
}
You can paste this code at the bottom of your scripts.js file just before closing jQuery.
Please also find attached working example zip file.
Just to point out the code will work only on smaller screen than 992px so to test on the desktop you can resize the browser window but then you must refresh the page.
Let me know if you have any questions at all.
Cheers!
Lazar
Sweet. The new toggle function works great. Exactly what I was looking for.
As for the gallery issue. What you had suggested was one of the things I had tried but the look of the magnific popup isn't something I'm in love with. However, after painstakingly going into the plugins.css file I was able to override some of the styles to make it look exactly like the cbp lightbox (changing the arrows, getting rid of the magnifying glass, etc).
So everything seems to be working out just great. I haven't tested everything on any actual mobile devices since I only have the test server running on my machine. Hopefully everything runs smoothly when I host it.
Thanks for all your help. If I need anything else, I know where to ask!