1$(function(){ 2 3 //Showing blog items 4 $('#blog-items .more-info').click(function(e){ 5 e.preventDefault(); 6 var targetId = $(this).attr('href'); 7 $('#blog-items').hide(); 8 $(targetId+', #full-blog-items #blog-back').hide().removeClass('hidden').fadeIn('400', 'easeInOutCubic'); 9 }); 10 11 $('#blog-back').click(function(e){ 12 e.preventDefault(); 13 $('.blogitem-content:visible, #blog-back').hide().addClass('hidden'); 14 $('#blog-items').fadeIn('400', 'easeInOutCubic'); 15 var documentBody = (($.browser.chrome)||($.browser.safari)) ? document.body : document.documentElement; 16 $(documentBody).animate({scrollTop: $('#blog').offset().top}, 1000,'easeInOutCubic'); 17 }); 18 19 //Blog item nav 20 $('.blogitem-content .pager a').click(function(e){ 21 e.preventDefault(); 22 var targetId = $(this).attr('href'); 23 $('.blogitem-content:visible').hide().addClass('hidden'); 24 $(targetId).hide().removeClass('hidden').fadeIn('400', 'easeInOutCubic'); 25 }); 26 27 //Showing portfolio items 28 $('#portfolio-items .more-info').click(function(e){ 29 e.preventDefault(); 30 var targetId = $(this).attr('href'); 31 $('#portfolio-items, #portfolio-filters').hide(); 32 $(targetId+', #portfolio-back').hide().removeClass('hidden').fadeIn('400', 'easeInOutCubic'); 33 }); 34 35 $('#portfolio-back').click(function(e){ 36 e.preventDefault(); 37 $('.portfolioitem-content:visible, #portfolio-back').hide().addClass('hidden'); 38 $('#portfolio-items, #portfolio-filters').fadeIn('400', 'easeInOutCubic'); 39 var documentBody = (($.browser.chrome)||($.browser.safari)) ? document.body : document.documentElement; 40 $(documentBody).animate({scrollTop: $('#portfolio').offset().top}, 1000,'easeInOutCubic'); 41 }); 42 43 //portfolio item nav 44 $('.portfolioitem-content .pager a').click(function(e){ 45 e.preventDefault(); 46 var targetId = $(this).attr('href'); 47 $('.portfolioitem-content:visible').hide().addClass('hidden'); 48 $(targetId).hide().removeClass('hidden').fadeIn('400', 'easeInOutCubic'); 49 }); 50 51 52 53 //Isotop related actions 54 var $containerblog = $('#blog-items'); 55 // initialize isotope 56 $containerblog.imagesLoaded( function(){ 57 $containerblog.isotope({ 58 itemSelector : '.blogitem', 59 layoutMode : 'fitRows' 60 }); 61 62 }); 63 64 var $container = $('#portfolio-items'); 65 // initialize isotope 66 $container.imagesLoaded( function(){ 67 $container.isotope({ 68 itemSelector : '.portfolioitem', 69 layoutMode : 'fitRows' 70 }); 71 }); 72 73 // filter items when filter link is clicked 74 $('#portfolio-filters a').click(function(){ 75 $('#portfolio-filters a').parent('li').removeClass('active'); 76 var selector = $(this).attr('data-filter'); 77 $container.isotope({ filter: selector }); 78 $(this).parent('li').addClass('active'); 79 return false; 80 }); 81 82 83 //Timeline 84 $('.timeline-item-trigger span').click(function(){ 85 if($(this).hasClass('circle_plus')){$(this).removeClass('circle_plus').addClass('circle_minus');} 86 else{$(this).removeClass('circle_minus').addClass('circle_plus');} 87 }); 88 89 $('.timeline-item-title').click(function(){ 90 $trigger = $(this).parent().parent().find('.timeline-item-trigger span'); 91 if($trigger.hasClass('circle_plus')){$trigger.removeClass('circle_plus').addClass('circle_minus');} 92 else{$trigger.removeClass('circle_minus').addClass('circle_plus');} 93 }); 94 95 96 //Scroll 97 // top of page (action) 98 // (uncommented by magic - 2020-12-16 since not working anymore - syntax problem? 99 // $('.scroller').click(function(e) { 100 // e.preventDefault(); 101 // var targetScroll = $(this).attr('href'); 102 // var documentBody = (($.browser.chrome)||($.browser.safari)) ? document.body : document.documentElement; 103 // $(documentBody).stop().animate({scrollTop: $(targetScroll).offset().top}, 1000,'easeInOutCubic'); 104 // }); 105 106 107 //Sidebar height 108 function sidebarHeight(){ 109 var height = $('#main-content').height(); 110 $('#sidebar .sidebar-nav').height(height); 111 } 112 sidebarHeight(); 113 114 $('#main-content').resize(function() { 115 sidebarHeight(); 116 }); 117 118 119 //blogitem hover 120 $(document).on("mouseenter", '.blogitem, .portfolioitem', function(){ 121 $('.blogitem-hoverinfo, .portfolioitem-hoverinfo', this).stop(true, true).fadeIn('200', 'easeInOutCubic'); 122 }); 123 124 $(document).on("mouseleave", '.blogitem, .portfolioitem', function(){ 125 $('.blogitem-hoverinfo, .portfolioitem-hoverinfo', this).stop(true, true).fadeOut('200', 'easeInOutCubic'); 126 }); 127 128 129 //viewport listener : load script regarding viewport height 130 viewportWidth = $(window).width(); 131 if(viewportWidth >= 768){viewPortContext = "desktop";}else{viewPortContext = "mobile";} 132 133 function conditionalScripts(viewPortContext) { 134 135 newViewportWidth = $(window).width(); 136 if(newViewportWidth >= 768){newViewPortContext = "desktop";}else{newViewPortContext = "mobile";} 137 138 if(viewPortContext != newViewPortContext){ 139 140 if(newViewPortContext == 'desktop'){ //scripts for desktop only 141 142 //Add Tooltips 143 $('.tips').tooltip(); 144 $('.lightbox').unbind("click").fancybox(); 145 146 }else{ //scripts for mobile only 147 148 //Remove Tooltips 149 $('.tips').tooltip('destroy'); 150 $('.lightbox').unbind("click").photoSwipe(); 151 152 } 153 } 154 155 viewPortContext = newViewPortContext; 156 } 157 conditionalScripts(); //first execution 158 159 $(window).resize(function() { //execution on window resizing 160 conditionalScripts(); 161 }); 162 163 164});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.