Petra1999

Filtering Script Example | cloudythms.tumblr.com

Aug 2nd, 2018
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.12 KB | None | 0 0
  1. <!-- optional reset button.
  2.     give it class "ft" and id "reset"
  3.     the visible text doesn't matter. -->
  4. <div><u>optional:</u>
  5.     <span class="ft" id="reset">reset everything</span>
  6. </div>
  7.  
  8. <!-- here are the filter type buttons.
  9.     you don't have to have any, you can have a few or all.
  10.     give each type the classes "ft" and "t"
  11.     give the default type the class "active" as well
  12.     give each type one of these ids: single/and/or/not
  13.     the visible text does not matter, the ids do! -->
  14. <div><u>type:</u>
  15.   <span class="ft t active" id="single">[single]</span>
  16.   <span class="ft t" id="and">[and]</span>
  17.   <span class="ft t" id="or">[or]</span>
  18.   <span class="ft t" id="not">[not]</span>
  19. </div>
  20.  
  21.  
  22. <div><u>filters:</u>
  23. <!-- make a "show all" button, give it the id "all"
  24.     and the classes "ft" and "active".
  25.     the visible text doesn't matter. -->
  26.   <span class="ft active" id="all">(all)</span>
  27. <!-- give each filter the classes "ft" and "f"
  28.     the visible text of these filters is important!
  29.     write the tags the same way you do in the content.  -->
  30.   <span class="ft f" style="color:blue;">blue</span>
  31.   <span class="ft f" style="color:red;">red</span>
  32.   <span class="ft f" style="color:green;">green</span>
  33. </div>
  34.  
  35. <!-- wrap each thing (icon, ficrec, ...) in a class (here:"icon")
  36.     in there, you should have a class with the tags (here:"tags")
  37.     (the tags class wraps all tags, not each single tag)
  38.     do not use spaces ( ) or hypehns (-) in your tags,
  39.     use underscores (_) instead.
  40.     seperate tags by at least one space. you can also wrap
  41.     each one in a span if you want. (as shown here) -->
  42. <div class="icon">
  43. <div class="tags">
  44.     <span>blue</span>
  45. </div>
  46. </div>
  47.  
  48. <div class="icon">
  49. <div class="tags">
  50.     <span>blue</span> <span>red</span>
  51. </div>
  52. </div>
  53.  
  54. <div class="icon">
  55. <div class="tags">
  56.     <span>blue_red</span> <!-- this is ONE tag, it won't show for "blue" or "red" -->
  57. </div>
  58. </div>
  59.  
  60.  
  61. <div class="icon">
  62. <div class="tags">
  63.     <span>bluered</span> <!-- this is a completely different tag, it won't show for "blue" or "red" -->
  64. </div>
  65. </div>
Advertisement
Add Comment
Please, Sign In to add comment