Jquery(这个)帮助
只是想要一些快速帮助,我 90% 确定我需要使用(这个)调用/函数,因为我需要它来处理页面上的多个对象。但我不知道在哪里或如何将它放入我的 jquery 代码中,我试图在用户滚动到另一个对象上时为一个对象创建悬停状态,这是我的 jquery 代码,我希望这是有意义的,谢谢!
$("li.projectpost").hover(function () {
$("div.portfolio-title a").toggleClass("highlighter");
});
基本上我真正想知道的是,我想在页面上应用悬停效果的多个元素,就像现在一样,当我将鼠标悬停在一个项目上时,它们都会发生变化,但我想知道的是如何在滚动到父元素上时更改子元素中的 css 我想,我有一个 Div 包装器,当将鼠标悬停在内部 div 变化上时,这是否更有意义,仍在尝试将我的头围绕 jquery 感谢您的帮助! :)
谢谢大家的帮助!我刚刚想通了,我需要使用 - jQuery(this).find();谢谢!
Just wanted some quick help I'm 90% sure i need to use the (this) call/function because i need it to work on multiple objects on the page. but im not sure where or how to place it into my jquery code, im trying to create a hover state for a object once the user rolls over another , here is my jquery code, I hope this makes sense, thanks!
$("li.projectpost").hover(function () {
$("div.portfolio-title a").toggleClass("highlighter");
});
Basically all i really want to know is, I have more than one element on the page that I would like to apply a hover effect to, as is right now, when i hover over one item they all change, but I want to know is how to change the css in a child element when rolled over a parent I guess, I have a Div wrapper, that when hovered over an inside div changes, does that make better sense, Still trying to wrap my head around jquery thanks for the help! :)
Thanks for the help everyone! I just figured this out, I needed to use -
jQuery(this).find(); thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果需要,您可以传递两个回调函数来悬停。我不清楚你在那里做什么,但我认为这就是你需要的:
You can pass two callback functions to hover if you need that. I don't clearly get what you're doing there but I think this is what you need:
http://jsfiddle.net/tbq3x/13/
尝试上面的小提琴。你的代码工作正常。
http://jsfiddle.net/tbq3x/13/
Just try the above fiddle. Your code works fine.
感谢大家的帮助!我刚刚想通了,我需要使用 -
为了选择彼此内部的元素,所以我的代码最终看起来像这样
到目前为止,它似乎工作得很好!再次感谢!
Thanks for the help everyone! I just figured this out, I needed to use -
Inorder to select elements inside each other so my code ended up looking like this
So far it seems to work great! thanks again!
上面的应该有效,告诉我它是如何进行的。
The above should work, tell me how it goes.
将代码放入
$(document).ready()
方法中Put your code in
$(document).ready()
method