script.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. jQuery(document).ready(function($) {
  2. //window scrolls check
  3. // $(window).scroll(function() {
  4. // var topOfWindow = $(window).scrollTop();
  5. // // console.log('topOfWindow',topOfWindow);
  6. // if (topOfWindow > 100) {
  7. // $("#top-bar").addClass("reduced");
  8. // }
  9. // else {
  10. // $("#top-bar").removeClass("reduced");
  11. // }
  12. // });
  13. // init categories content images behaviour
  14. // console.log($(window).width());
  15. if( $(window).width() > 600 ){
  16. // if($('body').is('.categories')){
  17. // // console.log('hello');
  18. // var $diapo = $('<div id="diaporama"></div>');
  19. // $("#categories-content")
  20. // .before($diapo)
  21. // .find('li.project').each(function(index, el) {
  22. // // console.log(index);
  23. // $(this)
  24. // .addClass('projet-'+index)
  25. // .hover(function (e) {
  26. // $diapo.children().removeClass('visible');
  27. // var c = $(this).attr('class').match('projet-[0-9]+');
  28. // console.log("class",c[0]);
  29. // $diapo.children('.'+c[0]).addClass('visible');
  30. // })
  31. // .find('.projet-img')
  32. // .addClass('projet-'+index)
  33. // .appendTo($diapo);
  34. // });
  35. // $diapo.children('.projet-img').first().addClass('visible');
  36. // }
  37. // init Isotope
  38. var $grid = $('.grid').isotope({
  39. itemSelector: '.grid-block',
  40. transitionDuration: '0.4s'
  41. });
  42. // $grid.imagesLoaded().progress(function(){
  43. // $grid.masonry('layout');
  44. // });
  45. // filter items on button click
  46. $('#left-nav a, .projet-block nav.categories a').on( 'click', function(e) {
  47. e.preventDefault();
  48. var filterValue = $(this).attr('data-filter');
  49. $grid.isotope({ filter: filterValue });
  50. return false;
  51. });
  52. // init Masonry
  53. // var $grid = $('.grid').masonry({
  54. // itemSelector: '.grid-block',
  55. // transitionDuration: '0.4s'
  56. // });
  57. //
  58. // $grid.imagesLoaded().progress(function(){
  59. // $grid.masonry('layout');
  60. // });
  61. }
  62. });