vdw / HideSeek

A simple, mobile-friendly, yet customizable quick/live search jQuery plugin.
http://vdw.github.io/HideSeek
Apache License 2.0
429 stars 74 forks source link

Result blocks #52

Open SimonFricker opened 7 years ago

SimonFricker commented 7 years ago

include other classes to not be hidden when they are searched.

eg:

Fruit - Price banana - $5 apple - $2

if you search for banana. the Price of the banana will be hidden. As a user I would like to see both the fruit and the price, which are contained in the same div but are part of their own containers.

maxwroc commented 5 years ago

I'm not sure what you mean. I can try to help but please give a real example on jsfiddle/codepen.

Probably solution to your issue is to use "attribute" on the main container element e.g.:

<div class="mylist">
  <div data-name="banana">
    <div class="name">banana</div>
    <div class="price">$5</div>
  </div>
  <div data-name="apple">
    <div class="name">apple</div>
    <div class="price">$2</div>
  </div>
</div> 

And you initialize hideseek with:

$(".search").hideseek({
  list: "mylist",
  attribute: "data-name"
})