简体   繁体   English

我的jQuery .hover正常工作,但无法获得.click的工作

[英]My jQuery .hover's are working fine, but I can't get .click to work

My aim is to make this text change to opacity: 0 on click. 我的目标是使此文本更改为opacity: 0单击时为opacity: 0 However, I can't get it to respond. 但是,我无法回应。

HTML 的HTML

<div class="click-contact">
    <h2 class="insignia-inner-text">contact</h2>
</div>

jQuery jQuery的

jQuery(document).ready(function() { 
    jQuery(".click-contact").click(function() {
            jQuery(".insignia-inner-text").css({"opacity": "0"});
    }); 
});

JSfiddle: http://jsfiddle.net/Gy787/ JSfiddle: http : //jsfiddle.net/Gy787/

I'm using wordpress so I have to run noConflict, but it's been working fine for all of my .hover functions. 我使用的是wordpress,因此我必须运行noConflict,但是对于我所有的.hover函数来说,它都运行良好。

Can anyone spot what I'm doing wrong? 谁能发现我在做什么错?

You have not included jQuery in fiddle. 您尚未在小提琴中包含jQuery It is working fine. 一切正常。

Make sure your contact are not loading dynamically in that case use : 在这种情况下,请确保您的联系人没有动态加载:

jQuery(document).ready(function() { 
    jQuery("div").on('click','.click-contact', function() {
            jQuery(".insignia-inner-text").css({"opacity": "0"});
    }); 
});

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

相关问题 我无法使用我的Jquery:需要在点击时动态添加img标签 - I can't get my Jquery to work: Need to add img tag dynamically upon click 为什么我的节点服务器无法从我的节点服务器获得任何响应到 chrome 浏览器,但它在邮递员上工作正常? - Why i can't get any response from my node server to chrome browser but it's working fine on postman? 我无法让我的jquery在我的wordpress网站上工作 - I can't get my jquery to work in my wordpress site 我无法让jQuery手风琴在点击时崩溃? - I can't get my jQuery accordion to collapse on click? 为什么我无法使jQuery的live()或load()正常工作? - Why can't I get jQuery's live() or load() to work? 我无法让 jQuery animation 与我的 js 一起工作 - I can't get the jQuery animation to work with my js jQuery on(click)不起作用,但on(hover)起作用 - jquery on(click) doesn't work but on(hover) does 我似乎无法让我的悬停效果在按钮上工作。 尝试了很多技巧 - i can't seem to get my hover effects to work on button. have tried many tips 我无法取回我的数据,Post 功能工作正常,经邮递员测试 - I can't get my data back, The Post function is working fine, tested with postman 无法让jQuery的.replaceWith()工作? - Can't get jQuery's .replaceWith() to work?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM