1jQuery(document).ready(function($) { 2 3/*------------------------------------------------ 4 DECLARATIONS 5------------------------------------------------*/ 6 var loader = $('#loader'); 7 var loader_container = $('#preloader'); 8 var scroll = $(window).scrollTop(); 9 var scrollup = $('.backtotop'); 10 var menu_toggle = $('.menu-toggle'); 11 var nav_menu = $('.main-navigation ul.nav-menu'); 12 var featured_slider = $('.featured-slider-wrapper'); 13 var hero_slider = $('.hero-slider'); 14 var project_slider = $('.project-slider'); 15 var client_slider = $('.client-slider'); 16 var fitnesscat_slider = $('.fitnesscat-slider'); 17 var trending_slider = $('.trending-slider'); 18 var posts_height = $('.blog-posts-wrapper article .post-item'); 19 var masonry_gallery = $('.grid'); 20 var portfolio_gallery = $('.portfolio-grid'); 21 var testimonial_slider = $('.default-testimonial'); 22 var modern_testimonial_slider = $('.modern-testimonial'); 23 var naturegallery_slider = $('.naturegallery-slider'); 24 var naturefeatured_slider = $('.naturefeatured-slider'); 25 26/* ----------------------------------------- 27 Preloader 28 ----------------------------------------- */ 29 loader_container.delay(1000).fadeOut(); 30 loader.delay(1000).fadeOut("slow"); 31 32/*------------------------------------------------ 33 BACK TO TOP 34------------------------------------------------*/ 35 36 $(window).scroll(function() { 37 if ($(this).scrollTop() > 1) { 38 scrollup.css({bottom:"25px"}); 39 } 40 else { 41 scrollup.css({bottom:"-100px"}); 42 } 43 }); 44 45 scrollup.click(function() { 46 $('html, body').animate({scrollTop: '0px'}, 800); 47 return false; 48 }); 49 50/*------------------------------------------------ 51 MAIN NAVIGATION 52------------------------------------------------*/ 53 $('#top-bar > button').click(function(){ 54 $('#top-bar .wrapper').slideToggle(); 55 $('#top-bar').toggleClass('topbar-menu-active'); 56 }); 57 58 menu_toggle.click(function(){ 59 $(this).toggleClass('active'); 60 nav_menu.slideToggle(); 61 $('body').toggleClass('menu-toggled'); 62 $('button.dropdown-toggle').removeClass('active'); 63 $('#masthead').find('.sub-menu').slideUp(); 64 }); 65 66 $('.main-navigation .nav-menu .menu-item-has-children > a').after( $('<button class="dropdown-toggle"><i class="fa fa-angle-down"></i></button>') ); 67 68 $('button.dropdown-toggle').click(function() { 69 $(this).toggleClass('active'); 70 $(this).parent().find('.sub-menu').first().slideDown(); 71 }); 72 73 $(window).scroll(function() { 74 if ($(this).scrollTop() > 1) { 75 $('.menu-sticky #masthead').addClass('nav-shrink'); 76 } 77 else { 78 $('.menu-sticky #masthead').removeClass('nav-shrink'); 79 } 80 }); 81 82 // Keyboard Navigation 83 if( $(window).width() < 1024 ) { 84 nav_menu.find("li").last().bind( 'keydown', function(e) { 85 if( !e.shiftKey && e.which === 9 ) { 86 e.preventDefault(); 87 $('#masthead').find('.menu-toggle').focus(); 88 } 89 }); 90 91 $('button.dropdown-toggle').focus(function() { 92 $(this).addClass('active'); 93 $(this).parent().find('.sub-menu').first().slideDown(); 94 95 if( $('button.dropdown-toggle').hasClass('active') ) { 96 $(this).addClass('active'); 97 $(this).parent().find('.sub-menu').first().slideDown(); 98 } 99 }); 100 101 } 102 else { 103 nav_menu.find("li").unbind('keydown'); 104 } 105 106 $(window).resize(function() { 107 if( $(window).width() < 1024 ) { 108 nav_menu.find("li").last().bind( 'keydown', function(e) { 109 if( !e.shiftKey && e.which === 9 ) { 110 e.preventDefault(); 111 $('#masthead').find('.menu-toggle').focus(); 112 } 113 }); 114 115 $('button.dropdown-toggle').focus(function() { 116 $(this).addClass('active'); 117 $(this).parent().find('.sub-menu').first().slideDown(); 118 119 if( $('button.dropdown-toggle').hasClass('active') ) { 120 $(this).addClass('active'); 121 $(this).parent().find('.sub-menu').first().slideDown(); 122 } 123 }); 124 125 } 126 else { 127 nav_menu.find("li").unbind('keydown'); 128 } 129 });
130 131 // Shift + Tab Key Keyboard Navigation 132 menu_toggle.on('keydown', function (e) { 133 var tabKey = e.keyCode === 9; 134 var shiftKey = e.shiftKey; 135 136 if( menu_toggle.hasClass('active') ) { 137 if ( shiftKey && tabKey ) { 138 e.preventDefault(); 139 nav_menu.find("li:last-child > a").focus(); 140 nav_menu.find("li").last().bind( 'keydown', function(e) { 141 if( !e.shiftKey && e.which === 9 ) { 142 e.preventDefault(); 143 $('#masthead').find('.menu-toggle').focus(); 144 } 145 }); 146 }; 147 } 148 }); 149 150 if( $(window).width() < 1024 ) { 151 $( '#top-bar' ).find('li').last().bind( 'keydown', function(e) { 152 if( e.which === 9 ) { 153 e.preventDefault(); 154 $('#top-bar').find('button').focus(); 155 } 156 }); 157 } 158 else { 159 $( '#top-bar' ).find('li').unbind('keydown'); 160 } 161 $(window).resize(function() { 162 if( $(window).width() < 1024 ) { 163 $( '#top-bar li' ).find('li').bind( 'keydown', function(e) { 164 if( e.which === 9 ) { 165 e.preventDefault(); 166 $('#top-bar').find('button').focus(); 167 } 168 }); 169 } 170 else { 171 $( '#top-bar li' ).find('li').unbind('keydown'); 172 } 173 }); 174 175/*------------------------------------------------ 176 SLICK SLIDER 177------------------------------------------------*/ 178 $('.naturegallery-slider').slick(); 179 $('.hero-slider').slick(); 180 featured_slider.slick({ 181 responsive: [ 182 { 183 breakpoint: 992, 184 settings: { 185 slidesToShow: 1 186 } 187 }, 188 { 189 breakpoint: 767, 190 settings: { 191 slidesToShow: 1, 192 arrows: false 193 } 194 } 195 ] 196 }); 197 198 project_slider.slick({ 199 responsive: [ 200 { 201 breakpoint: 992, 202 settings: { 203 slidesToShow: 2, 204 arrows: false, 205 dots: false 206 } 207 }, 208 { 209 breakpoint: 767, 210 settings: { 211 slidesToShow: 1, 212 arrows: false 213 } 214 } 215 ] 216 }); 217 218 219 trending_slider.slick({ 220 responsive: [ 221 { 222 breakpoint: 992, 223 settings: { 224 slidesToShow: 2 225 } 226 }, 227 { 228 breakpoint: 767, 229 settings: { 230 slidesToShow: 1, 231 arrows: false 232 } 233 } 234 ] 235 }); 236 237 238 testimonial_slider.slick({ 239 responsive: [ 240 { 241 breakpoint: 992, 242 settings: { 243 slidesToShow: 2, 244 arrows: false, 245 dots: false 246 } 247 }, 248 { 249 breakpoint: 767, 250 settings: { 251 slidesToShow: 1, 252 arrows: false 253 } 254 } 255 ] 256 }); 257 258 259 260 261 naturefeatured_slider.slick({ 262 responsive: [ 263 { 264 breakpoint: 992, 265 settings: { 266 slidesToShow: 2, 267 arrows: false, 268 dots: false 269 } 270 }, 271 { 272 breakpoint: 767, 273 settings: { 274 slidesToShow: 1, 275 arrows: false 276 } 277 } 278 ] 279 }); 280 281 282 modern_testimonial_slider.slick({ 283 responsive: [ 284 { 285 breakpoint: 992, 286 settings: { 287 slidesToShow: 1, 288 arrows: false, 289 dots: false 290 } 291 }, 292 { 293 breakpoint: 767, 294 settings: { 295 slidesToShow: 1, 296 arrows: false 297 } 298 } 299 ] 300 }); 301 client_slider.slick({ 302 responsive: [ 303 { 304 breakpoint: 1024, 305 settings: { 306 slidesToShow: 3 307 } 308 }, 309 { 310 breakpoint: 767, 311 settings: { 312 slidesToShow: 2 313 } 314 }, 315 { 316 breakpoint: 567, 317 settings: { 318 slidesToShow: 1, 319 arrows: false 320 } 321 } 322 ] 323 });
324 325 326 fitnesscat_slider.slick({ 327 responsive: [ 328 { 329 breakpoint: 1200, 330 settings: { 331 slidesToShow: 5 332 } 333 }, 334 { 335 breakpoint: 992, 336 settings: { 337 slidesToShow: 4, 338 arrows: false 339 } 340 }, 341 { 342 breakpoint: 767, 343 settings: { 344 slidesToShow: 2 345 } 346 }, 347 { 348 breakpoint: 567, 349 settings: { 350 slidesToShow: 1, 351 arrows: false 352 } 353 } 354 ] 355 }); 356 357 358$('.gallery-slider').slick({ 359 asNavFor: '.gallery-slider-nav' 360}); 361 362$('.gallery-slider-nav').slick({ 363 slidesToShow: 6, 364 slidesToScroll: 1, 365 asNavFor: '.gallery-slider', 366 arrows: true, 367 dots: false, 368 infinite: true, 369 focusOnSelect: true, 370 autoplay:true, 371 responsive: [ 372 { 373 breakpoint: 1200, 374 settings: { 375 slidesToShow: 5, 376 arrows: false 377 } 378 }, 379 { 380 breakpoint: 900, 381 settings: { 382 slidesToShow: 4, 383 arrows: false 384 } 385 }, 386 { 387 breakpoint: 767, 388 settings: { 389 slidesToShow: 3, 390 arrows: false 391 } 392 }, 393 { 394 breakpoint: 500, 395 settings: { 396 slidesToShow: 2, 397 arrows: false 398 } 399 } 400 ] 401}); 402$('.rightslide-slider').slick(); 403/*------------------------------------------------ 404 MATCH HEIGHT 405------------------------------------------------*/ 406 407 $('.single #primary .navigation a').matchHeight(); 408 $('#mustread .entry-container').matchHeight();
409 $('#tips .entry-container').matchHeight(); 410 $('#featured .entry-container').matchHeight(); 411 $('#popular .entry-container').matchHeight(); 412 $('#timetable .timetable-items').matchHeight(); 413 $('#features .features-item-wrapper .features-content').matchHeight(); 414 $('#project .entry-container').matchHeight(); 415 $('#services article .services-item-wrapper').matchHeight(); 416 417/*------------------------------------------------ 418 Tabs 419------------------------------------------------*/ 420 421$('#portfolio ul.tabs li').click(function(event) { 422 event.preventDefault(); 423 424 var tab_id = $(this).attr('data-tab'); 425 426 $('#portfolio ul.tabs li').removeClass('active'); 427 $('#portfolio .tab-content').removeClass('active'); 428 $('#portfolio .tab-content').fadeOut(); 429 $(this).addClass('active'); 430 $("#"+tab_id).fadeIn(); 431 432}); 433 434$('#details ul.tabs li').click(function(event) { 435 event.preventDefault(); 436 437 var tab_id = $(this).attr('data-tab'); 438 439 $('#details ul.tabs li').removeClass('active'); 440 $('#details .tab-content').removeClass('active'); 441 $('#details .tab-content').fadeOut(); 442 $(this).addClass('active'); 443 $("#"+tab_id).fadeIn(); 444 445}); 446 447/*------------------------------------------------ 448 MASONRY GALLERY 449------------------------------------------------*/ 450 451 masonry_gallery.imagesLoaded( function() { 452 masonry_gallery.packery({ 453 itemSelector: '.grid-item' 454 }); 455 }); 456 portfolio_gallery.imagesLoaded( function() { 457 portfolio_gallery.packery({ 458 itemSelector: '.portfolio-grid-item' 459 }); 460 }); 461 462/*------------------------------------------------ 463 END JQUERY 464------------------------------------------------*/ 465 466});
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.