1/* 2 * 3 * Omni v1.2 - omni.js 4 * Custom JavaScript and jQuery scripts for Omni HTML Theme that is being sold on ThemeForest. 5 * One Page VERSION 6 * 7 */ 8 9 10 /* ================================================== 11 # Check if website is viewed on a mobile & tablet 12 ================================================== */ 13 (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|android|ipad|playbook|silk|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera); 14 15 16jQuery(document).ready(function() { 17 18 /* ================================================== 19 # Fix Page Height Chrysostomos 20 ================================================== */ 21 if(!(jQuery('#IsHomePage').length > 0)){ 22 var TopHght = jQuery('#top').outerHeight(); 23 var NavHght = jQuery('#main-nav').outerHeight(); 24 var FootHght = jQuery('footer.footer-type').outerHeight(); 25 var docHght = jQuery( document ).height(); 26 //alert(docHght + "-" + NavHght + "+" + TopHght + "+" + FootHght); 27 jQuery('section.hentry').css("min-height", docHght-(TopHght + NavHght + FootHght+10) + "px"); 28 } 29 /* ================================================== 30 # One Page Navigation 31 ================================================== */ 32 jQuery('#main-nav').onePageNav({ 33 currentClass: 'current-menu-item', 34 scrollSpeed: 800, 35 scrollOffset: 28, 36 scrollThreshold: 0.5 37 }); 38 39 40 /* ================================================== 41 # AJAX Posts Navigation 42 ================================================== */ 43 if (jQuery('.ajaxed').length > 0) { 44 jQuery(document).on('click', '#paging-links a', function(event){ 45 event.preventDefault(); 46 var post_id = jQuery(this).attr('href'); 47 48 jQuery('.ajaxed').fadeTo(500, 0.1); 49 //jQuery.scrollTo( jQuery('#blog'), 800, {offset:-28} ); 50 51 52 53 jQuery('.ajaxed').load(post_id+' .ajaxed', function(){ 54 jQuery('.ajaxed').fadeTo(500, 1); 55 }); 56 }); 57 } 58 59 60 /* ================================================== 61 # Scroll To 62 ================================================== */ 63 jQuery('.scroll-to').click(function(e){ 64 var href = jQuery(this).attr('href'); 65 jQuery.scrollTo( jQuery(href), 800, {offset:-28} ); 66 e.preventDefault(); 67 }); 68 69 /* ================================================== 70 # Page Header Slogan FadeIn 71 ================================================== */ 72 jQuery('#page-header .slogan').each(function(){ 73 jQuery(this).css('opacity', 0); 74 jQuery(this).delay(800).fadeTo(800, 1); 75 }); 76 77 78 /* ================================================== 79 # Isotope Portfolio 80 ================================================== */ 81 jQuery( '.portfolio' ).each(function(){ 82 83 var $this = jQuery(this); 84 var $container = $this.find( '.portfolio-items' ); 85 var $filter = $this.find( '.filter' ) 86 87 $container.imagesLoaded( function(){ 88 89 // Add Isotope plugin to portfolio-items 90 $container.isotope({ 91 itemSelector: '.item', 92 masonry: { 93 columnWidth: $container.width() / 12 94 } 95 }); 96 97 // update columnWidth on window resize 98 jQuery(window).smartresize(function(){ 99 $container.isotope({ 100 masonry: { columnWidth: $container.width() / 12 } 101 }); 102 }); 103 104 // Filter the portfolio items by data filter attribute 105 $filter.on('click', 'a', function(e) { 106 var selector = jQuery(this).data( 'filter' ); 107 108 $container.isotope({ 109 filter: selector 110 }); 111 jQuery(this).closest( 'li' ).addClass( 'active' ).siblings( 'li' ).removeClass( 'active' ); 112 113 e.preventDefault(); 114 }); 115 116 // Add class 'active' to 'All' 117 $filter.find( 'li' ).each(function() { 118 var filterData = jQuery(this).find( 'a' ).data( 'filter' ); 119 if ( filterData === '*' ) { 120 jQuery(this).addClass('active'); 121 } 122 }); 123 124 // Add Magnific Popup Images Gallery 125 $container.find( '.item-zoom' ).magnificPopup({ 126 type: 'image', 127 gallery: { 128 enabled: true 129 } 130 }); 131 132 // Add Magnific Popup for the Item Details 133 $container.find( '.item-link' ).magnificPopup({ 134 type: 'ajax', 135 ajax: { 136 settings: { 137 cache: false 138 } 139 }, 140 alignTop: true, 141 overflowY: 'scroll', 142 removalDelay: 300, 143 mainClass: 'mfp-zoom-in', 144 callbacks: { 145 updateStatus: function(data) { 146 if(data.status === 'ready') { 147 jQuery('.item-media.flexslider').flexslider({ 148 animation: "fade", 149 slideshow: false, 150 controlNav: false,
151 useCSS: false 152 }); 153 jQuery('.item-media.video').fitVids(); 154 } 155 } 156 } 157 }); 158 159 // Add Direction Aware Hover 160 $container.find( '.item' ).each( function() { 161 jQuery(this).hoverdir({ 162 hoverDelay : 0 163 }); 164 }); 165 166 }); 167 168 }); 169 170 171 /* ================================================== 172 # HEADING PARALLAX: Full Screen Height 173 ================================================== */ 174 function headerParallaxHeight() { 175 var parallaxHeight = jQuery(window).height() - jQuery('#top').outerHeight(); 176 if ( jQuery('#main-nav').length > 0 ) { 177 var parallaxHeight = jQuery(window).height() - jQuery('#top').outerHeight() - jQuery('#main-nav').outerHeight(); 178 } 179 jQuery( '.home-type.parallax-type, .home-type.parallax-type .parallax' ).css('height', parallaxHeight); 180 } 181 jQuery(window).resize(headerParallaxHeight); 182 headerParallaxHeight(); 183 184 185 /* ================================================== 186 # jQuery Plugins only for Desktop and Tablets 187 ================================================== */ 188 if ( jQuery(window).width() > 1024 ) { 189 if ( jQuery.browser.mobile === false ) { 190 191 192 /* ================================================== 193 # Parallax 194 ================================================== */ 195 jQuery( '.parallax' ).each(function(){ 196 jQuery(this).parallax("50%", 0.3); 197 }); 198 199 /* ================================================== 200 # Pricing Animation - since v1.2 201 ================================================== */ 202 var css = jQuery("<link>"); 203 css.attr( { rel: 'stylesheet', type: 'text/css', href: templateDir + '/assets/css/animate.css' } ); 204 jQuery('head').append(css); 205 206 jQuery( '.price-package' ).hover( function() { 207 jQuery(this).removeClass( 'normalize' ).addClass( 'animated enlarge' ); 208 }, function() { 209 jQuery(this).removeClass( 'enlarge' ).addClass( 'normalize' ); 210 }); 211 212 } 213 } 214 215 /* ================================================== 216 # Parallax Fix for Tablet Landscape View 217 ================================================== */ 218 if ( jQuery.browser.mobile === true ) { 219 jQuery( '.parallax' ).each(function(){ 220 jQuery(this).addClass( 'parallax-mobile' ); 221 }); 222 } 223 224 225 /* ================================================== 226 # jQuery Plugins only for Desktop 227 ================================================== */ 228 if ( jQuery(window).width() > 979 ) { 229 if ( jQuery.browser.mobile === false ) { 230 231 /* ================================================== 232 # Hover Directions 233 ================================================== */ 234 jQuery( '.services > [class*="span"]' ).each( function() { 235 jQuery(this).hoverdir({ 236 hoverDelay : 0 237 }); 238 }); 239 240 } 241 if ( jQuery.browser.mobile === true ) { 242 jQuery( '.service .back' ).css({ 243 'top': '0px', 244 'display': 'none' 245 }) 246 jQuery( '.services > [class*="span"]' ).hover( 247 function () { 248 jQuery(this).find('.back').css('display', 'block'); 249 }, 250 function () { 251 jQuery(this).find('.back').css('display', 'none'); 252 } 253 ); 254 } 255 } 256 257 258 /* ================================================== 259 # Home Element Fader 260 ================================================== */ 261 var elementFader = function() { 262 jQuery( '.element-fader' ).each( function() { 263 264 var $container = jQuery(this), 265 elementLength = jQuery(this).find( '.fade-element' ).length; 266 267 // Function for each fade element 268 $container.find( '.fade-element' ).delay(1400).each(function(index) { 269 jQuery(this).delay(3000 * index).fadeIn(1000, function() { 270 271 // If fade element is not last element detach the element 272 if ( index != elementLength - 1 ) { 273 jQuery(this).detach().appendTo($container).delay(800).fadeOut(800); 274 } 275 276 }); 277 }); 278 279 }); 280 }; 281 elementFader(); 282 283 284 /* ================================================== 285 # Skills Percentage Marker 286 ================================================== */ 287 jQuery( '.progress .bar' ).each(function() { 288 var percentage = jQuery(this).data( 'percentage' ); 289 jQuery(this).append('<span class="percentage-marker">' + percentage + '%</span>'); 290 }); 291 292 293 /* ================================================== 294 # Tooltip 295 ================================================== */ 296 jQuery( 'body' ).tooltip({ 297 selector: "a[data-toggle=tooltip]" 298 }); 299 300 301 /* ================================================== 302 # HEADING VIDEO: Load FitVids 303 ================================================== */ 304 jQuery( '.video-bg' ).fitVids(); 305 jQuery( '.blog-thumb.video' ).fitVids(); 306 307 308 /* ================================================== 309 # Twitter Feed 310 ================================================== */ 311 jQuery( '.tweet' ).each(function() { 312 var username = jQuery(this).data( 'twitter-username' ); 313 var count = jQuery(this).data( 'count' ); 314 jQuery(this).tweet({ 315 modpath: templateDir + '/assets/php/twitter/', 316 username: username, 317 avatar_size: 0, 318 count: count, 319 template: '{text}{time}', 320 }); 321 }); 322 323 324 /* ========================================================= 325 # Add Superfish for Dropdown Main Nav - since v1.1 326 ========================================================= */ 327 jQuery('ul.sf-menu').superfish({ 328 delay: 300, 329 cssArrows: false, 330 disableHI: true 331 }); 332 333 334 /* ========================================================= 335 # Add Mobile Menu for Main-Navigation 336 ========================================================= */ 337 jQuery('.main-menu').mobileMenu(); 338 339 340 /* ========================================================= 341 # Add Flexslider and FitVids to Blog Thumb 342 ========================================================= */ 343 jQuery('.blog-thumb.flexslider').flexslider({ 344 animation: "fade", 345 slideshow: false, 346 controlNav: false,
347 useCSS: false 348 }); 349 350}); 351 352 353/* ================================================== 354 # Carousels (one function) - Since v1.2 355 ================================================== */ 356 if ( jQuery( profileCarouselIds ).length > 0 ) 357 { 358 // store the slider in a local variable 359 var $window = jQuery(window), 360 flexslider_testimonials, 361 flexslider_team, 362 flexslider_clients; 363 364 // tiny helper function to add breakpoints 365 function getGridSize() { 366 return ((window.innerWidth || document.documentElement.clientWidth) < 480) ? 1 : 367 ((window.innerWidth || document.documentElement.clientWidth) > 479 && (window.innerWidth || document.documentElement.clientWidth) < 768) ? 2 : 368 ((window.innerWidth || document.documentElement.clientWidth) > 767 && (window.innerWidth || document.documentElement.clientWidth) < 980) ? 4 : 4; 369 } 370 371 // tiny helper function to add breakpoints 372 function getGridSizeSecond() { 373 return ((window.innerWidth || document.documentElement.clientWidth) < 480) ? 1 : 374 ((window.innerWidth || document.documentElement.clientWidth) > 479 && (window.innerWidth || document.documentElement.clientWidth) < 768) ? 1 : 375 ((window.innerWidth || document.documentElement.clientWidth) > 767 && (window.innerWidth || document.documentElement.clientWidth) < 980) ? 3 : 3; 376 } 377 378 /*$(function() { 379 SyntaxHighlighter.all(); 380 });*/ 381 382 $window.load(function() 383 { 384 jQuery( '.profile-carousel' ).each(function(){ 385 jQuery( this ).flexslider({ 386 animation: "slide", 387 slideshow: false, 388 itemWidth: 115, 389 itemMargin: 10, 390 useCSS: false, 391 minItems: getGridSize(), // use function to pull in initial value 392 maxItems: getGridSize(), // use function to pull in initial value 393 start: function(slider){ 394 flexslider_testimonials = slider; 395 } 396 }); 397 }); 398 399 jQuery( '.clients.carousel' ).each(function(){ 400 jQuery( this ).flexslider({ 401 animation: "slide", 402 slideshow: false, 403 controlNav: false, 404 itemWidth: 115, 405 itemMargin: 45, 406 useCSS: false, 407 minItems: getGridSizeSecond(), // use function to pull in initial value 408 maxItems: getGridSizeSecond(), // use function to pull in initial value 409 start: function(slider){ 410 flexslider_clients = slider; 411 } 412 }); 413 }); 414 }); 415 416 // check grid size on resize event 417 $window.resize(function() 418 { 419 var gridSize = getGridSize(); 420 421 if(flexslider_testimonials) 422 { 423 flexslider_testimonials.vars.minItems = gridSize; 424 flexslider_testimonials.vars.maxItems = gridSize; 425 } 426 427 if(flexslider_team) 428 { 429 flexslider_team.vars.minItems = gridSize; 430 flexslider_team.vars.maxItems = gridSize; 431 } 432 433 if(flexslider_clients) 434 { 435 gridSize = getGridSizeSecond(); 436 437 flexslider_clients.vars.minItems = gridSize; 438 flexslider_clients.vars.maxItems = gridSize; 439 } 440 }); 441 } 442 443 444/* ================================================== 445 # Mobile Navigation 446 ================================================== */ 447 function scrollTo(target){ 448 jQuery.scrollTo( jQuery(target), 800 ); 449 } 450 451 452jQuery(window).load(function() { 453 454 455 /* ================================================== 456 # Portfolio Slider 457 ================================================== */ 458 jQuery( '.portfolio-slider' ).flexslider({ 459 animation: "fade", 460 slideshow: false, 461 controlNav: false, 462 useCSS: false 463 }); 464 465 466 /* ================================================== 467 # Google Maps 468 ================================================== */ 469 /*(function() { 470 var gm = document.createElement('script'); 471 gm.src = 'http://maps.google.com/maps/api/js?v=3&sensor=false&language=en&callback=gmaps_loaded'; 472 gm.type = 'text/javascript'; 473 gm.async = 'true'; 474 var s = document.getElementsByTagName('script')[0]; 475 s.parentNode.insertBefore(gm, s); 476 477 window.gmaps_loaded = function() { 478 jQuery( '.google-maps' ).each(function() { 479 var options = { 480 map: { 481 address: jQuery(this).data( 'map-address' ), 482 options: { 483 zoom: jQuery(this).data( 'zoom' ) || 14, 484 styles: [ { 485 stylers: [ 486 { hue: jQuery(this).data( 'hue' ) }, 487 { saturation: jQuery(this).data( 'saturation' ) || -30 } 488 ] 489 } ], 490 scrollwheel: false, 491 mapTypeControl: false, 492 streetViewControl: false, 493 } 494 }, 495 marker: { 496 values:[ 497 {address: jQuery(this).data( 'marker-address' ), options:{icon: jQuery(this).data( 'marker-img' )}} 498 ], 499 } 500 }; 501 jQuery(this).gmap3(options); 502 }); 503 } 504 })();*/ 505 506 507 /* ================================================== 508 # HEADING TILED ITEMS: Tiled Portfolio 509 ================================================== */ 510 jQuery('.tiled-container').each(function(){ 511 512 var $tiledContainer = jQuery(this); 513 514 /* Add tiledItems plugin for tiledContainer 515 The amount of rows can be easily changed */ 516 $tiledContainer.tiledItems({ 517 rows: tiledItemsRows 518 }); 519 520 // If the variable showTiledOverlay exists 521 if ( $tiledContainer.find('.tiled-items .overlay').length > 0 ) { 522 $tiledContainer.find( '.item img' ).addClass( 'grayscale' ); 523 } 524 525 // On #hide-overlay click do this 526 $tiledContainer.on('click', '#hide-overlay, #hide-overlay-phone', function(e){ 527 $tiledContainer.find( '.overlay' ).fadeOut(); 528 $tiledContainer.find( '.item img' ).removeClass( 'grayscale' ); 529 if (!jQuery('#show-overlay').length) { 530 jQuery( '#top' ).find( '.adds' ).stop().append( '<li><a id="show-overlay" class="icon-arrows-ccw" href="#" data-placement="bottom" data-toggle="tooltip" title="Show Overlay"></a></li>' ); 531 } 532 e.preventDefault(); 533 }); 534 535 // On #show-overlay click do this 536 jQuery( '#top' ).find( '.adds' ).on('click', '#show-overlay', function(e){ 537 $tiledContainer.find( '.overlay' ).fadeIn(); 538 $tiledContainer.find( '.item img' ).addClass( 'grayscale' ); 539 jQuery(this).closest( 'li' ).remove(); 540 541 e.preventDefault(); 542 }); 543 544 }); 545 546 /* ============================================================== 547 # HEADING TILED ITEMS: Load the homepage - since v1.1 548 ============================================================== */ 549 jQuery( '.tiled-items' ).fadeIn(); 550 551 552 /* ================================================== 553 # Add affix to One Page Main Navigation 554 ================================================== */ 555 var offsetTopNav = jQuery( '.one-page-nav' ).offset().top; 556 jQuery('.one-page-nav').sticky({ topSpacing: 0 }); 557 //jQuery('.custSoc').sticky({ topSpacing: '50px' }); 558 559 jQuery(window).scroll(function(){ 560 if ( jQuery(document).scrollTop() >= offsetTopNav ) { 561 jQuery( '.nav-container, .custSoc' ).css('z-index', 'inherit'); 562 jQuery('.secSearch').show(); 563 } else if ( jQuery(document).scrollTop() <= offsetTopNav ) { 564 jQuery( '.nav-container, .custSoc' ).css('z-index', 200); 565 jQuery('.secSearch').hide(); 566 567 } 568 }); 569 570 /* ================================================== 571 # HEADING TILED ITEMS: Add affix to Home Overlay 572 ================================================== */ 573 if ( jQuery(window).width() > 1024 ) { 574 if ( jQuery.browser.mobile === false ) { 575 if(jQuery( '#home-header').length > 0){ 576 var offsetTopOverlay = jQuery( '#home-header.tiled-container' ).offset().top; 577 var offsetMainNav = jQuery( '#main-nav' ).offset().top; 578 jQuery( '#home-header.tiled-container .overlay, #home-header.tiled-container .items-container' ).affix({ 579 offset: { 580 top: function() { 581 return offsetTopOverlay; 582 } 583 } 584 }); 585 if ( jQuery(document).scrollTop() >= offsetMainNav ) { 586 jQuery( '#home-header.tiled-container .items-container' ).css('zIndex', '-10'); 587 jQuery( '#home-header.tiled-container .overlay' ).css('zIndex', '-10'); 588 } 589 590 jQuery(window).scroll(function(){ 591 if ( jQuery(document).scrollTop() >= (offsetTopOverlay + jQuery( '#home-header.tiled-container' ).outerHeight()) || jQuery(document).scrollTop() <= offsetTopOverlay ) { 592 jQuery( '#home-header.tiled-container .items-container' ).css('position', 'relative'); 593 jQuery( '#home-header.tiled-container .overlay' ).css('position', 'absolute'); 594 } else if ( jQuery(document).scrollTop() <= (offsetTopOverlay + jQuery( '#home-header.tiled-container' ).outerHeight()) ) { 595 jQuery( '#home-header.tiled-container .items-container' ).css('position', 'fixed'); 596 jQuery( '#home-header.tiled-container .overlay' ).css('position', 'fixed'); 597 } 598 if ( jQuery(document).scrollTop() <= offsetMainNav ) { 599 jQuery( '#home-header.tiled-container .items-container' ).css('zIndex', '0'); 600 jQuery( '#home-header.tiled-container .overlay' ).css('zIndex', '0'); 601 } 602 }); 603 } 604 } 605 } 606 607 608});
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.