最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Highlight multiple items on hover's condition - Stack Overflow

programmeradmin0浏览0评论

Okay sorry for the title, wasn't too sure how to phrase it.

So we have a project going, and we are offering multiple incentives depending on what people donate (similar to Kickstarter if you know what that is).

Anyway, what we have ben trying to figure out is when someone hovers on one price range we want the items they will receive to have full opacity, and then the same for the further down donation values.

Maybe the image will make more sense..

So the blue is the hover, and when you hover over the "$1+", items 1, 3, 4 are opaque. But when you hover over the "$15+" only items 1, 3 are opaque.

There are around 20 items, and 15 price brackets, all in which are interlinked with one another.

I assume this has to be one in JS, something I know nothing about.

Thank you :]

Edit: Thank you for all the tips. I have pleted the project with the css3 :not

And the fallback will be JS

Okay sorry for the title, wasn't too sure how to phrase it.

So we have a project going, and we are offering multiple incentives depending on what people donate (similar to Kickstarter if you know what that is).

Anyway, what we have ben trying to figure out is when someone hovers on one price range we want the items they will receive to have full opacity, and then the same for the further down donation values.

Maybe the image will make more sense..

So the blue is the hover, and when you hover over the "$1+", items 1, 3, 4 are opaque. But when you hover over the "$15+" only items 1, 3 are opaque.

There are around 20 items, and 15 price brackets, all in which are interlinked with one another.

I assume this has to be one in JS, something I know nothing about.

Thank you :]

Edit: Thank you for all the tips. I have pleted the project with the css3 :not

And the fallback will be JS

Share Improve this question edited Mar 12, 2012 at 0:42 markb asked Mar 6, 2012 at 0:21 markbmarkb 1,3151 gold badge21 silver badges62 bronze badges 3
  • Well, what does your HTML look like? – BoltClock Commented Mar 6, 2012 at 0:22
  • This is probably best done with classes. Have a class for each "category" and assign classes to each item depending on whether they belong to that category. On hover, highlight (or whatever) all items with the related class. – Felix Kling Commented Mar 6, 2012 at 0:25
  • Re: we have ben trying to figure out -- so... did "ben" ever figure it out?
发布评论

评论列表(0)

  1. 暂无评论