admin管理员组文章数量:1318958
So I have to map an image, and I chose to use jQuery. The code works perfectly on my desktop, in the browser, code editors, etc. But whenever I try to port it to the WordPress website I'm managing (using Divi 4.6.6), it doesn't work.
I used the same code for both versions, except for the WP one using jQuery instead of the dollar sign for functions and selectors, because otherwise, WordPress won't recognize them.
UPDATE: jQuery is not noticing the events set for the "area" tags in WP, although it does locally. This is the main problem.
Here's the code in question. It's supposed to show a popup whenever the user hovers the cursor on specific parts of the image:
jQuery(document).ready(function($) {
$(document).ready(function () {
$("#popup").hide();
$("area").mouseleave(function(){$("#popup").hide()})
$('area').mouseenter(function(event)
{
$("#popup").show()
$('#popup').css("top",event.pageY)
$('#popup').css("left",event.pageX)
;})
})});
本文标签: htmlJQuery script working locally on desktopnot working on WordpressDivi
版权声明:本文标题:html - JQuery script working locally on desktop, not working on Wordpress + Divi 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742057518a2418384.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论