문제

I have a webpage with about 20 products wrapped in divs. I want to filter them by properties, for example price oder size, without reloading the page.

My first idea was to put the properties as the class-properties of the wrapper-div and hide them with jQuery. But this seems circuitous, especially when you try to get products within a price range.

Any ideas how to go about this?

도움이 되었습니까?

해결책

To mark properties in an html element, use Jquery .data() instead of using classes.

To filter the selection to hide or show, use Jquery .filter(), even if it is price range.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top