简体   繁体   English

使用Wordpress主题,无法在JavaScript中找到点击事件

[英]Using Wordpress theme, can't find click event in JavaScript

I'm using a Wordpress theme for a photography website and some of the javascript in the theme is disabling links that I'm trying to create. 我正在为摄影网站使用Wordpress主题,该主题中的某些javascript禁用了我要创建的链接。

http://www.joesingh.samcampsall.co.uk/login/ http://www.joesingh.samcampsall.co.uk/login/

Originally the image on this page would pop up in lightbox (which I presume is why the link is disabled), but I've made a template that allows the image to link to another page. 最初,此页面上的图像会在灯箱中弹出(我想这是为什么链接被禁用的原因),但是我已经制作了一个模板,允许该图像链接到另一个页面。 The link within the tags is correct, but when clicked nothing happens. 标记内的链接是正确的,但是单击时没有任何反应。

Using Chrome I can see that there's a 'click' event listener on the classes for the containing div ('one_third', 'gallery3') and this is in http://www.joesingh.samcampsall.co.uk/wp-includes/js/jquery/jquery.js?ver=1.8.3 使用Chrome浏览器,我可以看到包含div的类(“ one_third”,“ gallery3”)上有一个“单击”事件监听器,位于http://www.joesingh.samcampsall.co.uk/wp-includes中/js/jquery/jquery.js?ver=1.8.3

Unfortunately I'm a total novice, and a lot of searching and reading around hasn't allowed me to identify what changes I need to make. 不幸的是,我是一个新手,而且很多搜索和阅读并不能使我确定需要进行哪些更改。 Any pointers would be really appreciated. 任何指针将不胜感激。

If you have access to the code and you are a novice you could unbind the click event by doing something like the code below. 如果您可以访问该代码,而您是新手,则可以通过执行以下代码来取消click事件的绑定。 This will make your link behave in the normal way. 这将使您的链接以正常方式运行。 Just put the following after your other js files. 只需将以下内容放在其他js文件之后。

jQuery('.one_third').unbind('click');

You may need to play around with the class to make sure you get the right one. 您可能需要与该班级一起玩,以确保您获得正确的班级。

Good luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM