HTMLify
custom.js
Views: 4 | Author: cody
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | /* Author URI: http://webthemez.com/ Note: Licence under Creative Commons Attribution 3.0 Do not remove the back-link in this web template -------------------------------------------------------*/ $(window).load(function() { jQuery('#all').click(); return false; }); $(document).ready(function() { $('#header_wrapper').scrollToFixed(); $('.res-nav_click').click(function() { $('.main-nav').slideToggle(); return false }); function resizeText() { var preferredWidth = 767; var displayWidth = window.innerWidth; var percentage = displayWidth / preferredWidth; var fontsizetitle = 25; var newFontSizeTitle = Math.floor(fontsizetitle * percentage); $(".divclass").css("font-size", newFontSizeTitle) } if ($('#main-nav ul li:first-child').hasClass('active')) { $('#main-nav').css('background', 'none'); } $('#mainNav').onePageNav({ currentClass: 'active', changeHash: false, scrollSpeed: 950, scrollThreshold: 0.2, filter: '', easing: 'swing', begin: function() { }, end: function() { if (!$('#main-nav ul li:first-child').hasClass('active')) { $('.header').addClass('addBg'); } else { $('.header').removeClass('addBg'); } }, scrollChange: function($currentListItem) { if (!$('#main-nav ul li:first-child').hasClass('active')) { $('.header').addClass('addBg'); } else { $('.header').removeClass('addBg'); } } }); var container = $('#portfolio_wrapper'); container.isotope({ animationEngine: 'best-available', animationOptions: { duration: 200, queue: false }, layoutMode: 'fitRows' }); $('#filters a').click(function() { $('#filters a').removeClass('active'); $(this).addClass('active'); var selector = $(this).attr('data-filter'); container.isotope({ filter: selector }); setProjects(); return false; }); function splitColumns() { var winWidth = $(window).width(), columnNumb = 1; if (winWidth > 1024) { columnNumb = 4; } else if (winWidth > 900) { columnNumb = 2; } else if (winWidth > 479) { columnNumb = 2; } else if (winWidth < 479) { columnNumb = 1; } return columnNumb; } function setColumns() { var winWidth = $(window).width(), columnNumb = splitColumns(), postWidth = Math.floor(winWidth / columnNumb); container.find('.portfolio-item').each(function() { $(this).css({ width: postWidth + 'px' }); }); } function setProjects() { setColumns(); container.isotope('reLayout'); } container.imagesLoaded(function() { setColumns(); }); $(window).bind('resize', function() { setProjects(); }); $(".fancybox").fancybox(); }); wow = new WOW({ animateClass: 'animated', offset: 100 }); wow.init(); document.getElementById('').onclick = function() { var section = document.createElement('section'); section.className = 'wow fadeInDown'; section.className = 'wow shake'; section.className = 'wow zoomIn'; section.className = 'wow lightSpeedIn'; this.parentNode.insertBefore(section, this); }; |