按钮激活/停用列表中的元素(复杂情况) [英] Buttons activate/deactivate elements in list (complex case)

查看:73
本文介绍了按钮激活/停用列表中的元素(复杂情况)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尽我所能努力,但我认为我已经超越了这个,我只是没有jQuery知识来完成我需要的东西,我很新,你会看到。

I've been trying as hard as I can but I think I'm over my head on this one, I just don't have the jQuery knowledge to accomplish what I need, I'm pretty new as you will see.

这可能是一个复杂的案例,所以我会尽力解释:

This may be a complex case, so I will try to explain as good as I can:

我有一个项目列表,LI,按手风琴中的标题分组,因此当您展开/折叠一个部分时,您会看到该部分的相应列表。

I have a list of items, LIs, grouped by titles in an accordion, so when you expand/collapse a section, you see the corresponding list for that section.

每个部分包含列表,列表底部有两个按钮:清除所选全选

Each section contains the list and at the bottom of the list are two buttons: Clear Selected and Select All.

进入页面后,第一个手风琴部分会展开,在里面你会看到列表,在列表的底部你会看到Clear Selected和Select All按钮。 清除所选项按钮可见,但不活动。为了创建非活动效果,我在CSS中使用了不透明度:.5;

Upon entering the page, the first accordion section is expanded, inside you'll see the list, and at the bottom of the list you see the Clear Selected and Select All buttons. The Clear Selected button is visible but 'inactive'. To create the 'inactive' effect I just used opacity:.5; in the CSS. I need this button visible when it's 'inactive',

到目前为止,我已经能够通过全选按钮更改其类,但其余部分这些案例和行为对我来说太复杂了。

So far, I've been able to have the "Select All" button change its class, but the rest of the cases and behaviors are too complex for me.

按钮和列表中的元素之间以及按钮本身之间的交互是我需要帮助的。

The interaction between the buttons and the elements on the list, and between the buttons themselves is what I need help with.

仅供参考,我正在构建的是一个结果系统,您可以通过点击手风琴中的元素/选项来过滤这些结果。

Just FYI, what I'm building is a results system in which you can filter those results by clicking on the elements/options inside the accordions.

这是一个 DEMO

Here's a DEMO.

对此有任何帮助,我们非常感谢。

Any help on this it's greatly appreciated.

谢谢,

编辑 -

阅读 DEMO 了解所需的功能。

Read the comments in the JavaScript section of the DEMO to know the functionalities that are needed.

推荐答案

我想我有大多数的你问的制定。看看我的代码,看看它是不是你想要的。
http://www.jsfiddle.net/lmcculley/ujuH6/10/
希望它有效!

I think I have most of you're asking for worked out. Take a look at my code and see if it's what you're wanting. http://www.jsfiddle.net/lmcculley/ujuH6/10/ Hope it works!

这篇关于按钮激活/停用列表中的元素(复杂情况)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆