sexycullen

search box and style for theme 219

Jul 17th, 2021 (edited)
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. CSS PART:
  2.  
  3.  
  4. form {
  5. text-align:var(--descriptionTextPosition);
  6. }
  7.  
  8. .search .query {
  9. font-size:var(--descriptionFontSize);
  10. font-style:var(--descriptionFontStyle);
  11. font-weight:var(--descriptionFontWeight);
  12. text-align:var(--descriptionTextPosition);
  13. text-transform:var(--descriptionTextTransform);
  14. background: var(--sidebarBackgroundColor);
  15. color: var(--sidebarTextColor);
  16. border: 0;
  17. outline: 0;
  18. padding:5px 0;
  19. margin:10px 0px;
  20. }
  21.  
  22. .query::placeholder {
  23. color: var(--sidebarTextColor);
  24. background: var(--sidebarBackgroundColor);
  25. }
  26.  
  27. input:focus::-webkit-input-placeholder {color: transparent;}
  28. input:focus:-moz-placeholder {color: transparent;}
  29. input:focus::-moz-placeholder {color: transparent;}
  30. input:focus:-ms-input-placeholder { color: transparent;}
  31.  
  32. _________________________________________________________
  33.  
  34. HTML PART:
  35.  
  36. <form class="search" action="javascript:return false">
  37. <input type="text" class="query" placeholder="search tags">
  38. </form>
  39.  
  40. _________________________________________________________
  41.  
  42. SCRIPT PART: instead searching for <script> only, search for: <script type="text/javascript">
  43.  
  44. $(document).ready(function(){
  45. $('.search').submit(function(event){
  46. var value = $('input:first').val();
  47. location.replace('http://{Name}.tumblr.com/tagged/' + value);
  48. });
  49. });
Advertisement
Add Comment
Please, Sign In to add comment