site.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. function hovercat() {
  2. var $work = $('.navbar > ul > li:nth-child(1)');
  3. var $workafter = $('.navbar > ul > li:nth-child(1)::after');
  4. var $cat = $('.navbar > ul.tags');
  5. $work.hover(
  6. function() {
  7. $( this ).addClass( "hover" );
  8. $(this).parents().find('.tags').addClass("visible");
  9. }, function() {
  10. $( this ).removeClass( "hover" );
  11. $(this).parents().find('.tags').removeClass("visible");
  12. }
  13. );
  14. $cat.hover(
  15. function() {
  16. $( this ).addClass( "visible" );
  17. $(this).parents().find($work).addClass('hover');
  18. }, function() {
  19. $( this ).removeClass( "visible" );
  20. $(this).parents().find($work).removeClass('hover');
  21. }
  22. );
  23. }
  24. function active() {
  25. var $work = $('.navbar > ul > li:nth-child(1)');
  26. $work.click(function(event) {
  27. $(this).parents().find('.tags').toggleClass("active");
  28. });
  29. }
  30. function catprojets() {
  31. $(window).load(function () {
  32. var $content = $('.content');
  33. var $txt = $('#items .content .txt');
  34. var $cat = $('#items .content .taxonomy');
  35. var $Hcontent = $content.outerHeight();
  36. var $Hcat = $cat.outerHeight();
  37. var $Htxt = $Hcontent - $Hcat;
  38. $txt.css({
  39. "height" : $Htxt + "px"
  40. });
  41. });
  42. }
  43. jQuery(document).ready(function($) {
  44. active();
  45. hovercat();
  46. catprojets();
  47. });