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. //
  27. // $work.click(function(event) {
  28. // $(this).parents().find('.tags').toggleClass("active");
  29. // });
  30. // }
  31. function catprojets() {
  32. $(window).load(function () {
  33. var $content = $('.content');
  34. var $txt = $('#items .content .txt');
  35. var $cat = $('#items .content .taxonomy');
  36. var $Hcontent = $content.outerHeight();
  37. var $Hcat = $cat.outerHeight();
  38. var $Htxt = $Hcontent - $Hcat;
  39. $txt.css({
  40. "height" : $Htxt + "px"
  41. });
  42. });
  43. }
  44. jQuery(document).ready(function($) {
  45. // active();
  46. hovercat();
  47. catprojets();
  48. });