works on single
This commit is contained in:
@@ -733,7 +733,13 @@
|
||||
|
||||
//hide caption on desktop
|
||||
if (!isMobile) {
|
||||
$('.wp-block-gallery, .wp-block-image').children('figcaption').hide()
|
||||
$('.wp-block-gallery img, .wp-block-image img').hover(function () {
|
||||
$(this).parent('a').next("figcaption").addClass("vis")
|
||||
}, function () {
|
||||
$('.wp-block-gallery .vis, .wp-block-image .vis')
|
||||
.removeClass("vis")
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -770,7 +776,48 @@
|
||||
|
||||
//single images
|
||||
$(".wp-block-image a").colorbox(colorboxSettings)
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------- hover and click on related ---------------------------- */
|
||||
$(document).on({
|
||||
mouseenter: function () {
|
||||
if (!Modernizr.touchevents) {
|
||||
showTitle(this)
|
||||
}
|
||||
},
|
||||
mouseleave: function () {
|
||||
if (!Modernizr.touchevents) {
|
||||
hideTitle(this)
|
||||
}
|
||||
}
|
||||
}, '#related_posts li');
|
||||
|
||||
//touch on small articles
|
||||
$(document).on({
|
||||
'touchend': function (e) {
|
||||
e.preventDefault()
|
||||
var art = $(this).parents("li")
|
||||
var metadata = art.children(".metadata")
|
||||
if (metadata.hasClass("vis")) {
|
||||
hideTitle(art)
|
||||
} else {
|
||||
hideTitle($(".vis").parents("li"))
|
||||
showTitle(art)
|
||||
}
|
||||
}
|
||||
}, "#related_posts li a.related_thumbnailwrapper")
|
||||
|
||||
//click on related
|
||||
$('#related_posts li').click(function () {
|
||||
let href = $(this).children('a.related_thumbnailwrapper').attr("href")
|
||||
window.open(href, "_self")
|
||||
})
|
||||
|
||||
|
||||
}//if single end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* ------------------------------- END OF FILE ------------------------------ */
|
||||
|
||||
Reference in New Issue
Block a user