From 20a8afa9ceb9f757e0d9d9258efe7b48f127f2f9 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Fri, 4 Nov 2022 13:40:46 +0100 Subject: [PATCH] JS: Open .js-img-hover image in a new tab on click --- public/js/site.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/js/site.js b/public/js/site.js index 68f6991..ef22a2c 100644 --- a/public/js/site.js +++ b/public/js/site.js @@ -31,6 +31,12 @@ $(document).ready(function() { $("#img-hover").remove(); }); + // Image hover on click + $(".js-img-hover").click(function() { + var url = $(this).data("img-hover"); + window.open(url, '_blank'); + }); + // Lazy load video's $(window).on('resize scroll', function() { $('.js-video').each(function(index) {