1// Set jQuery to NoConflict Mode 2jQuery.noConflict(); 3jQuery(function() { 4var base_url = jQuery('input[name="base_url"]').val(); 5 /* Nofication Close Buttons */ 6 jQuery('.notification a.close').click(function(e){ 7 e.preventDefault(); 8 9 jQuery(this).parent('.notification').fadeOut(); 10 }); 11 var wi = jQuery(window).width(); 12 var eventheight= jQuery('.eventMainBox').height(); 13 14 15 // Responsive layout, resizing the items 16 if (wi >= 482){ 17 jQuery('#foo4').carouFredSel({ 18 responsive: true, 19 auto: false, 20 prev: '#prev3', 21 next: '#next3', 22 width: '100%', 23 scroll: 1, 24 items: { 25 width: 100, 26 // height: '30%', // optionally resize item-height 27 visible: { 28 min: 1, 29 max: 6 30 } 31 } 32 }); 33 }else{jQuery('#foo4').carouFredSel({ 34 responsive: true, 35 auto: false, 36 prev: '#prev3', 37 next: '#next3', 38 width: '100%', 39 scroll: 1, 40 items: { 41 width: 400, 42 // height: '30%', // optionally resize item-height 43 visible: { 44 min: 1, 45 max: 5 46 } 47 } 48 });} 49 50 jQuery('input, textarea').placeholder(); 51 52 /*FLAX SLIDER*/ 53 54 55 jQuery('.browse').click(function(){ 56 if(jQuery(this).hasClass('col') ){ 57 jQuery('nav').animate({ 58 left: "0", 59 },500); 60 jQuery(this).removeClass('col'); 61 jQuery(".backgroundDummy").css('display','block'); 62 63 64 /*if (wi <= 640){ 65 jQuery('#mainFrame').css('position','fixed'); 66 jQuery('nav').css('position','absolute'); 67 }*/ 68 69 70 }else{ 71 jQuery('nav').animate({ 72 left: "-205", 73 },500); 74 jQuery(this).addClass('col'); 75 /*if (wi <= 640){ 76 jQuery('#mainFrame').css('position','static'); 77 jQuery('nav').css('position','fixed'); 78 }*/ 79 }; 80 81 }); 82 jQuery('.backgroundDummy').click(function(){ 83 jQuery('nav').animate({ 84 left: "-205", 85 },500); 86 jQuery(".browse").addClass('col'); 87 jQuery(this).css('display','none'); 88 89 }); 90 91 92 93 var stage = jQuery(".body").css("height","3850px"); 94 var topStage = jQuery('.topBg').height() +79; 95 96 97 jQuery(window).scroll(function() { 98 var win_height = jQuery(window).scrollTop(); 99 if( (win_height >= topStage)&&(wi >= 1031) ) { 100 jQuery('.body').css('height','auto'); 101 jQuery('#mainFrame').css('margin-top',topStage); 102 jQuery('#mainFrame').addClass('static'); 103 104 }else if(wi <= 1024){ 105 jQuery('.body').css('height','auto'); 106 //jQuery('#mainFrame').css('margin-top','89px'); 107 jQuery('#mainFrame').addClass('static'); 108 jQuery("body").niceScroll({cursorcolor:"#8e8d8d",cursoropacitymax:0.7,touchbehavior:true}); 109 110 if (wi > 640){ 111 jQuery('#mainFrame').css('margin-top','89px'); 112 }else{ 113 jQuery('#mainFrame').css('margin-top','131px'); 114 } 115 116 }else { 117 jQuery('.body').css("height","3850px"); 118 jQuery('#mainFrame').removeClass('static'); 119 jQuery('#mainFrame').css('margin-top','69px'); 120 } 121 }); 122 123 jQuery(".scrollTopText").click(function(){ 124 jQuery('html, body').animate({ 125 scrollTop: jQuery(".scollclear").offset().top 126 },500); 127 128 }); 129 130 jQuery("#sb-search2 .sb-icon-search").click(function(){ 131 132 jQuery( ".display" ).toggle(function(){ 133 jQuery(this).animate({ 134 "top": "40px", 135 }, 500 ); 136 }); 137 }); 138 139 jQuery(".nav").niceScroll({cursorcolor:"#8e8d8d",cursoropacitymax:0.7,touchbehavior:true}); 140 141 142 jQuery('.down-arrow a').click(function(event){ 143 var $anchor = jQuery(this); 144 jQuery('html, body').stop().animate({ 145 scrollTop: jQuery($anchor.attr('href')).offset().top 146 },800); 147 event.preventDefault(); 148 }); 149 150 jQuery.fn.slideFadeToggle = function(speed, easing, callback) { 151 return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); 152 }; 153 154 jQuery('.accordion').accordion({ 155 //defaultOpen: 'section1', 156 cookieName: 'nav', 157 speed: 'slow', 158 animateOpen: function (elem, opts) { //replace the standard slideUp with custom function 159 elem.next().stop(true, true).slideFadeToggle(opts.speed); 160 }, 161 animateClose: function (elem, opts) { //replace the standard slideDown with custom function 162 elem.next().stop(true, true).slideFadeToggle(opts.speed); 163 } 164 }); 165 166 /*========================= 167 =========TINY CAROUSAL BOX======== 168 ===========================*/ 169 170 jQuery('#slider1').tinycarousel({ 171 axis : "y" 172 }); 173 174 175 /*========================= 176 =========SELECT BOX======== 177 ===========================*/ 178 179 // Iterate over each select element 180jQuery('select').each(function () { 181 182 // Cache the number of options 183 var jQuerythis = jQuery(this), 184 numberOfOptions = jQuery(this).children('option').length; 185 186 // Hides the select element 187 jQuerythis.addClass('s-hidden'); 188 189 // Wrap the select element in a div 190 jQuerythis.wrap('<div class="select"></div>'); 191 192 // Insert a styled div to sit over the top of the hidden select element 193 jQuerythis.after('<div class="styledSelect"></div>'); 194 195 // Cache the styled div 196 var jQuerystyledSelect = jQuerythis.next('div.styledSelect'); 197 198 // Show the first select option in the styled div 199 jQuerystyledSelect.text(jQuerythis.children('option').eq(0).text()); 200 201 // Insert an unordered list after the styled div and also cache the list 202 var jQuerylist = jQuery('<ul />', { 203 'class': 'options' 204 }).insertAfter(jQuerystyledSelect); 205 206 // Insert a list item into the unordered list for each select option 207 for (var i = 0; i < numberOfOptions; i++) { 208 jQuery('<li />', { 209 text: jQuerythis.children('option').eq(i).text(), 210 rel: jQuerythis.children('option').eq(i).val() 211 }).appendTo(jQuerylist); 212 } 213 214 // Cache the list items 215 var jQuerylistItems = jQuerylist.children('li'); 216 217 // Show the unordered list when the styled div is clicked (also hides it if the div is clicked again) 218 jQuerystyledSelect.click(function (e) { 219 e.stopPropagation(); 220 jQuery('div.styledSelect.active').each(function () { 221 jQuery(this).removeClass('active').next('ul.options').hide(); 222 }); 223 jQuery(this).toggleClass('active').next('ul.options').toggle(); 224 }); 225 226 // Hides the unordered list when a list item is clicked and updates the styled div to show the selected list item 227 // Updates the select element to have the value of the equivalent option 228 jQuerylistItems.click(function (e) { 229 e.stopPropagation(); 230 jQuerystyledSelect.text(jQuery(this).text()).removeClass('active'); 231 jQuerythis.val(jQuery(this).attr('rel')); 232 jQuerylist.hide(); 233 /* alert(jQuerythis.val()); Uncomment this for demonstration! */ 234 }); 235 236 // Hides the unordered list when clicking outside of it 237 jQuery(document).click(function () { 238 jQuerystyledSelect.removeClass('active'); 239 jQuerylist.hide(); 240 }); 241 242 var prevSelect = jQuerystyledSelect.prev(); 243 var arr = ['register_membership_type','register_area_of_coverage','register_o_state','register_r_state']; 244 if(jQuery.inArray(prevSelect.attr('name'),arr) != "-1"){ 245 jQuerystyledSelect.text(prevSelect.find( "option:selected" ).text()).removeClass('active'); 246 } 247}); 248 249 function scrollToTopFunc(){ 250 jQuery('html, body').animate({scrollTop: 0}, 10); 251 return false;
252 } 253 // Events filter and pagination --STARTS 254 jQuery('#ajax_sortby_type li').click(function(){ 255 scrollToTopFunc(); 256 jQuery('input[name="sort_type"]').val('1'); 257 jQuery('.animation_image').hide(); 258 jQuery('.animation_image').html('<img src="'+base_url+'/assets/images/ajax-loader.gif">'); 259 var _value = jQuery(this).find('a').data('id'); 260 jQuery('input[name="sort_value"]').val(_value); 261 jQuery('input[name="page_loaded"]').val('0'); 262 jQuery('input[name="page_no"]').val('1'); 263 ajax_call(_value); 264 }); 265 266 jQuery('#ajax_sortby_time li').click(function(){ 267 scrollToTopFunc(); 268 jQuery('.animation_image').hide(); 269 jQuery('.animation_image').html('<img src="'+base_url+'/assets/images/ajax-loader.gif">'); 270 if(jQuery(this).find('a').data('value') == 'week'){ 271 jQuery('input[name="sort_type"]').val('2'); 272 var _value = 0; 273 } 274 else if(jQuery(this).find('a').data('value') == 'month'){ 275 jQuery('input[name="sort_type"]').val('3'); 276 var _value = 0; 277 } 278 jQuery('input[name="sort_value"]').val(_value); 279 jQuery('input[name="page_loaded"]').val('0'); 280 jQuery('input[name="page_no"]').val('1'); 281 ajax_call(_value); 282 }); 283 //For Event Type _value = id of event type 284 //For Week/Month _value = nothing 285 function ajax_call(_value){ 286 jQuery.ajax({ 287 cache: false, 288 type: "POST", 289 timeout: 5000, 290 data: { sort_type : jQuery('input[name="sort_type"]').val(),sort_value : _value,group :0}, 291 url: base_url + "events/events_conferences/aj_sortby", 292 success: function(response) 293 { 294 jQuery("#results").html(response); 295 }, 296 error: function(msg) 297 { 298 alert('Something gone wrong while retrieving the data...Please refresh the page and try again.'); 299 } 300 }); 301 } 302 303 jQuery(window).scroll(function() 304 { 305 if(((jQuery(window).scrollTop() + jQuery(window).height()) > (jQuery(document).height())-280) && jQuery('input[name="page_loaded"]').val() == '0' && (jQuery('input[name="sort_type"]').val() > 0)) 306 { 307 var sort_type = jQuery('input[name="sort_type"]').val(); 308 var _value = jQuery('input[name="sort_value"]').val(); 309 var page_loaded = jQuery('input[name="page_loaded"]').val(); 310 var page_no = jQuery('input[name="page_no"]').val(); 311 jQuery('.animation_image').show(); 312 jQuery('input[name="page_loaded"]').val('1'); 313 ajax_pagination(sort_type,page_no,page_loaded,_value); 314 } 315 }); 316 317 function ajax_pagination(sort_type,page_no,page_loaded,_value){ 318 jQuery.ajax({ 319 cache: false, 320 type: "POST", 321 timeout: 5000, 322 data: { sort_type : sort_type,sort_value : _value,group :page_no}, 323 url: base_url + "events/events_conferences/aj_sortby", 324 success: function(res) 325 { 326 res1 = jQuery("#results").html(); 327 if(res.trim() == '<!--<div class="clearfix"></div> -->' && !(res1.match('section')) && page_no =='1') 328 { 329 jQuery('.animation_image').html('<center>No event to show.</center>'); 330 }else if(res.trim() == '<!--<div class="clearfix"></div> -->') 331 { 332 jQuery('.animation_image').html('<center>No more events to show.</center>'); 333 }else if(res) 334 { 335 jQuery("#results").append(res); 336 jQuery('.animation_image').hide(); 337 jQuery('input[name="page_no"]').val(parseInt(page_no)+1); 338 jQuery('input[name="page_loaded"]').val('0'); 339 } 340 }, 341 error: function(xhr, ajaxOptions, thrownError) { //any errors? 342 alert(thrownError); //alert with HTTP error 343 jQuery('.animation_image').hide(); //hide loading image 344 jQuery('input[name="page_loaded"]').val('0'); 345 } 346 }); 347 } 348 // Events filter and pagination --ENDS 349 350 351 // Articles filter and pagination --STARTS 352 jQuery('#article_sortby_category li').click(function(){ 353 var category_id = jQuery(this).find('a').data('id'); 354 var urlToPost; 355 scrollToTopFunc(); 356 jQuery('.animation_image').hide(); 357 jQuery('.animation_image').html('<img src="'+base_url+'/assets/images/ajax-loader.gif">'); 358 jQuery('input[name="category"]').val(category_id); 359 if(jQuery('input[name="news_type"]').val() == 'top_news_category' || jQuery('input[name="news_type"]').val() == 'top_news'){ 360 jQuery('input[name="news_type"]').val('top_news_category'); 361 }else if(jQuery('input[name="news_type"]').val() == 'in_focus_category' || jQuery('input[name="news_type"]').val() == 'in_focus'){ 362 jQuery('input[name="news_type"]').val('in_focus_category'); 363 }else if(jQuery('input[name="news_type"]').val() == 'latest_category' || jQuery('input[name="news_type"]').val() == 'latest'){ 364 jQuery('input[name="news_type"]').val('latest_category'); 365 } 366 367 jQuery('input[name="page_loaded"]').val('0'); 368 jQuery('input[name="page_no"]').val('1'); 369 370 if(jQuery('input[name="news_type"]').val() == 'top_news_category'){ 371 urlToPost = base_url + "articles/articles/top_news_sortby_category"; 372 }else if(jQuery('input[name="news_type"]').val() == 'in_focus_category'){ 373 urlToPost = base_url + "articles/articles/in_focus_sortby_category"; 374 }else if(jQuery('input[name="news_type"]').val() == 'latest_category'){ 375 urlToPost = base_url + "articles/articles/latest_sortby_category"; 376 } 377 378 jQuery.ajax({ 379 cache: false, 380 type: "POST", 381 timeout: 5000, 382 data: { category : category_id,page :0}, 383 url: urlToPost, 384 success: function(response) 385 { 386 jQuery("#results").html(response); 387 }, 388 error: function(msg) 389 { 390 alert('Something gone wrong while retrieving the data...Please refresh the page and try again.'); 391 } 392 }); 393 }); 394 395 jQuery(window).scroll(function() 396 { 397 if(((jQuery(window).scrollTop() + jQuery(window).height()) > (jQuery(document).height()) - 280) && jQuery('input[name="page_loaded"]').val() == '0' && (jQuery('input[name="news_type"]').val() != '')) 398 { 399 var urlToPost; 400 var news_type = jQuery('input[name="news_type"]').val(); 401 var category = jQuery('input[name="category"]').val(); 402 var page_loaded = jQuery('input[name="page_loaded"]').val(); 403 var page_no = jQuery('input[name="page_no"]').val(); 404 jQuery('.animation_image').show(); 405 jQuery('input[name="page_loaded"]').val('1'); 406 407 if(jQuery('input[name="news_type"]').val() == 'top_news'){ 408 urlToPost = base_url + "articles/articles/top_news"; 409 }else if(jQuery('input[name="news_type"]').val() == 'top_news_category'){ 410 urlToPost = base_url + "articles/articles/top_news_sortby_category"; 411 }else if(jQuery('input[name="news_type"]').val() == 'in_focus'){ 412 urlToPost = base_url + "articles/articles/in_focus"; 413 }else if(jQuery('input[name="news_type"]').val() == 'in_focus_category'){ 414 urlToPost = base_url + "articles/articles/in_focus_sortby_category"; 415 }else if(jQuery('input[name="news_type"]').val() == 'latest'){ 416 urlToPost = base_url + "articles/articles/latest";
417 }else if(jQuery('input[name="news_type"]').val() == 'latest_category'){ 418 urlToPost = base_url + "articles/articles/latest_sortby_category"; 419 }else{ 420 return false; 421 } 422 423 jQuery.ajax({ 424 cache: false, 425 type: "POST", 426 timeout: 5000, 427 data: { category : category,page :page_no}, 428 url: urlToPost, 429 success: function(result) 430 { 431 if(result.trim() == "<div>No more articles.</div>") 432 { 433 jQuery("#results").append(result); 434 jQuery('.animation_image').hide(); 435 }else if(result.trim() == "<div>No articles.</div>"){ 436 jQuery("#results").append(result); 437 jQuery('.animation_image').hide(); 438 }else if(result) 439 { 440 jQuery("#results").append(result); 441 jQuery('.animation_image').hide(); 442 jQuery('input[name="page_no"]').val(parseInt(page_no)+1); 443 jQuery('input[name="page_loaded"]').val('0'); 444 } 445 }, 446 error: function(xhr, ajaxOptions, thrownError) { //any errors? 447 alert(thrownError); //alert with HTTP error 448 jQuery('.animation_image').hide(); //hide loading image 449 jQuery('input[name="page_loaded"]').val('0'); 450 } 451 }); 452 } 453 }); 454 // Articles filter and pagination --ENDS 455}); 456 457 458 459 460/** 461 * Themewich Theme Functions 462 * 463 * Copyright 2013, Andre Gagnon - http://themewich.com 464 * 465 */ 466(function( $ ){ 467 "use strict"; 468 469 /** 470 * Converts html image to full fixed background 471 * @since v1.0 472 * (c) Copyright 2013 Andre Gagnon - http://themewich.com 473 */ 474 $.fn.parallaxImg = function(){ 475 if ($('body').hasClass('full-width')){ 476 $(this).each(function(){ 477 var $this = jQuery(this), 478 parallaxsrc = $this.attr('src'), 479 closestdiv = $this.closest('div'); 480 481 // Set background div based on image 482 var $parallaxbg = $this.before('<div class="full-bg-image" style="background-image: url('+parallaxsrc+');"></div>'); 483 484 // If there's a caption set 485 if (closestdiv.hasClass('wp-caption')) { 486 closestdiv.removeClass('wp-caption').addClass('post-break has-caption').css('width', 'auto'); 487 } else { // otherwise 488 $('.full-bg-image').wrap('<div class="post-break"></div>'); 489 } 490 $this.remove(); 491 }); 492 } 493 } 494 495 496 /** 497 * Sticky nav menu 498 * @since v1.0 499 * (c) Copyright 2013 Andre Gagnon - http://themewich.com 500 */ 501 $.fn.themewichStickyNav = function(){ 502 var sticky_nav = jQuery(this), 503 nav_container = sticky_nav.closest('.top-nav'), 504 sticky_cells = sticky_nav.find('.cell'), 505 site_container = jQuery('#sitecontainer'), 506 sticky_height; 507 508 // Only run this once 509 if (!sticky_nav.hasClass('stickyloaded')) { 510 511 sticky_height = sticky_nav.find('.container').outerHeight(); 512 513 // Set just the height without padding 514 sticky_cells.css({ 515 'height' : sticky_height + 'px', 516 'padding': 0 517 }); 518 519 // Give nav container a fixed position 520 nav_container.css('position','fixed'); 521 522 // Give site container top padding 523 site_container.css({ 524 'padding-top' : sticky_height + (parseInt(sticky_cells.css('padding-top'))*2)//need to use padding due to fixed background bug in chrome 525 }); 526 527 // Add loaded indicator 528 sticky_nav.addClass('stickyloaded'); 529 } 530 531 function stickyHeader() { 532 sticky_cells.css({ 533 'height' : sticky_height - getScrollTop() 534 }); 535 } 536 537 // Cross browser scrolltop function 538 function getScrollTop(){ 539 if(typeof pageYOffset!= 'undefined'){ 540 //most browsers 541 return pageYOffset; 542 } 543 else{ 544 var B = document.body; //IE 'quirks' 545 var D = document.documentElement; //IE with doctype 546 D = (D.clientHeight)? D: B; 547 return D.scrollTop; 548 } 549 } 550 551 $(window).scroll(stickyHeader); 552 $(document).ready(stickyHeader); 553 554 } 555 556 557 /** 558 * Calls lightbox links 559 * @since v1.0 560 */ 561 $.fn.themewichLightbox = function() { 562 563 jQuery("a.themewich-lightbox").addClass('no-ajaxy'); 564 565 jQuery("a.themewich-lightbox").magnificPopup({ 566 type:'image', 567 closeBtnInside: true, 568 //tLoading: '<img src="' + agAjax.get_template_directory_uri + '/images/small-loading.gif"/>', 569 mainClass: 'mfp-zoom-in', 570 removalDelay: 500, //delay removal by X to allow out-animation 571 image: { 572 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 573 titleSrc: function(item) { 574 return item.el.find('img').attr('title'); 575 }, 576 markup: '<div class="mfp-figure">'+ 577 '<div class="mfp-close"></div>'+ 578 '<div class="mfp-img"></div>'+ 579 '<div class="mfp-bottom-bar">'+ 580 '<div class="mfp-title-wrapper"><div class="mfp-title"></div></div>'+ 581 '<div class="mfp-counter"></div>'+ 582 '</div>'+ 583 '</div>' // Popup HTML markup. `.mfp-img` div will be replaced with img tag, `.mfp-close` by close button 584 }, 585 callbacks: { 586 imageLoadComplete: function() { 587 var self = this; 588 setTimeout(function() { 589 self.wrap.addClass('mfp-image-loaded'); 590 }, 16); 591 }, 592 close: function() { 593 this.wrap.removeClass('mfp-image-loaded'); 594 } 595 }, 596 closeOnContentClick: true, 597 midClick: true 598 }); 599 600 jQuery('.open-popup-link').magnificPopup({ 601 type: 'inline', 602
603 fixedContentPos: false, 604 fixedBgPos: true, 605 //tLoading: '<img src="' + agAjax.get_template_directory_uri + '/images/small-loading.gif"/>', 606 607 overflowY: 'auto', 608 609 closeBtnInside: true, 610 preloader: false, 611 612 midClick: true, 613 removalDelay: 300, 614 mainClass: 'my-mfp-slide-bottom' 615 }); 616 617 jQuery('.gallery').each(function(){ 618 619 jQuery(this).magnificPopup({ 620 delegate: 'a.lightbox-gallery:not(.bx-clone a.lightbox-gallery)', 621 type: 'image', 622 closeBtnInside: true, 623 //tLoading: '<img src="' + agAjax.get_template_directory_uri + '/images/small-loading.gif"/>', 624 mainClass: 'mfp-zoom-in', 625 removalDelay: 500, //delay removal by X to allow out-animation 626 gallery: { 627 enabled: true, 628 navigateByImgClick: true, 629 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 630 }, 631 image: { 632 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 633 titleSrc: function(item) { 634 return item.el.find('img').attr('title'); 635 }, 636 markup: '<div class="mfp-figure">'+ 637 '<div class="mfp-close"></div>'+ 638 '<div class="mfp-img"></div>'+ 639 '<div class="mfp-bottom-bar">'+ 640 '<div class="mfp-title-wrapper"><div class="mfp-title"></div></div>'+ 641 '<div class="mfp-counter"></div>'+ 642 '</div>'+ 643 '</div>' // Popup HTML markup. `.mfp-img` div will be replaced with img tag, `.mfp-close` by close button 644 }, 645 callbacks: { 646 imageLoadComplete: function() { 647 var self = this; 648 setTimeout(function() { 649 self.wrap.addClass('mfp-image-loaded'); 650 }, 16); 651 }, 652 close: function() { 653 this.wrap.removeClass('mfp-image-loaded'); 654 } 655 }, 656 closeOnContentClick: true, 657 midClick: true 658 }); 659 }); 660 } 661 662 663 /** 664 * Matches title height to box height for centering on hover 665 * @since v1.0 666 * (c) Copyright 2013 Andre Gagnon - http://themewich.com 667 */ 668 $.fn.matchHeight = function() { 669 function match_height() { 670 jQuery('a.postlink .title').not('a.postlink .title.noimages').each(function() { 671 var height = jQuery(this).closest('.postphoto').height(); 672 jQuery(this).css({'height' : height + 'px'} ); 673 }); 674 } 675 match_height(); 676 $(window).resize(function(){ 677 match_height(); 678 }); 679 } 680 681 682 /** 683 * Adds javascript hover effects 684 * @since v1.0 685 * (c) Copyright 2013 Andre Gagnon - http://themewich.com 686 */ 687 /*$.fn.themewichHovers = function() { 688 689 function hover_overlay_slides() { 690 jQuery('.featured-image a').each(function() { 691 var $this = jQuery(this).parent().find('img'); 692 jQuery(this).hover( function() { 693 $this.stop().animate({opacity : 0.5}, 250, 'easeOutCubic'); 694 }, function() { 695 $this.stop().animate({opacity : 1}, 250, 'easeOutCubic'); 696 }); 697 }); 698 } 699 700 function hover_overlay_isotope() { 701 jQuery('.no-opacity a.postlink').each(function(){ 702 // Hover Function 703 jQuery(this).hover(function(){ 704 jQuery(this).find('.overlay').stop().animate({'opacity' : 0.75}, 500, 'easeOutCubic'); 705 }, function(){ 706 jQuery(this).find('.overlay').stop().animate({'opacity' : 0}, 500, 'easeOutCubic'); 707 }); 708 }); 709 } 710 711 hover_overlay_isotope(); 712 713 function hover_overlay_portfolio() { 714 715 jQuery('a.thumblink').each(function() { 716 jQuery(this).closest('.featured-image').addClass('highlight').addClass('loaded').css({'min-height': '0'}); 717 var $this = jQuery(this).find('img'); 718 $this.hover( function() { 719 $this.stop().animate({opacity : 0.5}, 250, 'easeOutCubic'); 720 }, function() { 721 $this.stop().animate({opacity : 1}, 250, 'easeOutCubic'); 722 }); 723 }); 724 } 725 726 function hide_loading() { 727 jQuery('.featured-image').not('.isobrick .featured-image').css({'background': 'none', 'min-height': '0'}); 728 } 729 730 (function($){ $(window).load(function() { hover_overlay_portfolio(); hover_overlay_images(); hide_loading(); }); })(jQuery); 731 732 733 function hover_overlay_images() { 734 735 jQuery('a img').not('.single-slideshow a img, .featured-image img, .ag_recentprojects_widget a img, .gallery a img, a img.fullimg, a img.fixedimg, .wp-caption a img').each(function() { 736 jQuery(this).hover( function() { 737 var $this = jQuery(this).parent().children('img'); 738 jQuery($this).stop().animate({opacity : 0.5}, 250, 'easeOutCubic'); 739 }, function() { 740 var $this = jQuery(this).parent().children('img'); 741 jQuery($this).stop().animate({opacity : 1}, 250, 'easeOutCubic'); 742 }); 743 744 }); 745 746 } 747 748 }*/ 749 750 751 jQuery('.bxslider li').hover(function(){ 752 jQuery(this).children('.blkContent').stop().animate({bottom : 0}, 500, 'easeOutCubic'); 753 }, function() { 754 var $this = jQuery(this).parent().children('img'); 755 jQuery(this).children('.blkContent').stop().animate({bottom : -360}, 500, 'easeOutCubic'); 756 }); 757 758 jQuery('.storyBoxImage').hover(function(){ 759 jQuery(this).children('.blkContent').stop().animate({bottom : 0}, 500, 'easeOutCubic'); 760 }, function() { 761 var $this = jQuery(this).parent().children('img'); 762 jQuery(this).children('.blkContent').stop().animate({bottom : -200}, 500, 'easeOutCubic'); 763 }); 764 765 766 767 /** 768 * Responsive slider object 769 * @type {class} 770 */ 771 var themewichSlider = { 772 773 createSlider : function(selector, callback) { 774 775 jQuery(selector).each(function(index) { 776 777 // Get Options from HTML 778 var $this = jQuery(this), 779 $info = $this.closest('.info'), 780 $touch = ($info.hasClass('postphoto')) ? false : true, 781 $window = jQuery(window), 782 autoPlay = $info.hasClass('autoplay') ? true : false, 783 pauseDelay = 5000, 784 pauseDelay = $info.attr('data-pause') ? parseInt($info.attr('data-pause'), 10) : pauseDelay, 785 pauseDelay = $info.hasClass('random') ? (Math.floor(Math.random()*10001) + 3000) : pauseDelay, 786 speedDelay = $info.attr('data-speed') ? parseInt($info.attr('data-speed'), 10) : 500, 787 pagerOption = $info.hasClass('pager') ? true : false, 788 pagerOption = $info.find('.bxslider li').length > 1 ? pagerOption : false, 789 carousel = $info.hasClass('carousel') ? true : false, 790 autoHover = $info.hasClass('hovergo') ? false : true, 791 slideMode = 'fade', 792 slideMode = $info.hasClass('horizontal') ? 'horizontal' : slideMode, 793 slideMode = $info.hasClass('vertical') ? 'vertical' : slideMode, 794 adaptive = $info.hasClass('noadapt') ? false : true; 795 796 if (pagerOption == false) { 797 $info.removeClass('pager'); 798 } 799 800 801 /** 802 * Carousel Slider 803 * @since v1.0 804 */ 805 function carouselSlider() { 806 var slideWidth = 320, 807 slideMargin = 10, 808 totalSlideWidth = slideWidth + slideMargin, 809 noWide = $('body').hasClass('full-width'); 810 811 $this.bxSlider({ 812 //Options 813 adaptiveHeight: adaptive, 814 minSlides: 2, 815 maxSlides: 9, 816 slideWidth: slideWidth, 817 slideMargin: slideMargin, 818 infiniteLoop: true, 819 pager: pagerOption, 820 controls: true, 821 autoControls: true, 822 useCSS: false, //Chrome gets buggy with this enabled 823 touchEnabled: true, 824 captions: false, 825 preloadImages: 'visible', 826 827 //After Slider Load 828 onSliderLoad: function() { 829 830 // Closest info container 831 $info = $this.closest('.info'); 832 833 // Fade in and add overlay effect 834 $this.animate({'opacity': 1}, 500, 'easeOutCubic'); 835 836 // Fade In Controls 837 $info.find('.bx-controls').animate({'opacity': 1}, 500); 838 839 // Remove min-height and loading image 840 $this 841 .animate({'opacity': 1}, 500, function() { 842 $this.closest('div.info') 843 .css({ 844 'min-height': 'none', 845 'background': 'none' 846 }); 847 }); 848 849 // Fix popup issue with cloned slides 850 var $clones = $this.find('.gallery-icon.bx-clone'), 851 $noclones = $this.find('.gallery-icon').not('.gallery-icon.bx-clone'); 852 853 $clones.click(function(e) { 854 var $clickedHref = $(this).find('a').attr('href'); 855 856 $noclones.each(function() { 857 var $link = $(this).find('a'); 858 if ($link.attr('href') == $clickedHref) { 859 $link.click(); 860 } 861 }); 862 e.preventDefault(); 863 }); 864 865 // Callback Function 866 if (callback && typeof(callback) === "function") { 867 callback(); 868 } 869 } 870 }); 871 } 872 873 874 /** 875 * Regular Slider 876 * @since v1.0 877 */ 878 function regularSlider() { 879 880 $this.bxSlider({ 881 // Options 882 adaptiveHeight: adaptive, 883 mode: slideMode, 884 auto: autoPlay, 885 speed: speedDelay, 886 pause: pauseDelay, 887 pager: pagerOption, 888 touchEnabled: $touch, 889 autoHover: autoHover, 890 captions: false, 891 responsive: true, 892 preloadImages: 'visible', 893 894 onSliderLoad: function() { 895 896 // Closest info container 897 $info = $this.closest('.info'); 898 899 // Recall isotope after slides load 900 if ($this.closest('.isotopeliquid').hasClass('isotope')){ 901 $('.isotopeliquid').isotope('reLayout'); 902 $('body').matchHeight(); 903 } else if ($this.closest('.isotopecontainer').hasClass('isotope')) { 904 $('.isotopecontainer').isotope('reLayout'); 905 $('body').matchHeight(); 906 } 907 908 // Center the title vertically 909 if($info.hasClass('titlerotator')) { 910 centerTextSlide($info); 911 $(window).smartresize(function(){ 912 centerTextSlide($info); 913 }).smartresize(); 914 } 915 916 // Fade In Controls 917 $info.find('.bx-controls').animate({'opacity': 1}, 500); 918 919 // Remove min-height and loading image 920 $this 921 .animate({'opacity': 1}, 500, function() { 922 $this.closest('div.info') 923 .css({ 924 'min-height': 'none', 925 'background': 'none' 926 }); 927 }); 928 929 if (callback && typeof(callback) === "function") { 930 callback(); 931 } 932 } 933 }); 934 935 } 936 937 938 /** 939 * Centers the slide text vertically 940 * @param {selector} $info Selector for the slide options 941 * @return {void} 942 */ 943 function centerTextSlide($info) { 944 if ($info.hasClass('titlerotator') && $info.hasClass('noadapt')) { 945 var $maxheight = $this.closest('.pagetitle').find('.bx-viewport').height(); 946 $this.children('li').each(function(){ 947 var $originalHeight = $(this).height(); 948 $(this).css('padding-top', ($maxheight-$originalHeight)/2); 949 }); 950 } 951 } 952 953 954 /** 955 * Slider initialization 956 */ 957 if (carousel) { 958 carouselSlider(); 959 } else { 960 regularSlider(); 961 } 962 963 }); 964 } 965 } 966 967 968 /** 969 * jQuery Isotope Class 970 * @since v1.0 971 */ 972 if(jQuery().isotope) { 973 974 var themewichIsotope = { 975 976 /** 977 * Full-Width Isotope function 978 * @param {string} selector Container selector 979 * @param {Function} callback Callback function 980 * @since v1.0 981 * (c) Copyright 2013 Andre Gagnon - http://themewich.com 982 */ 983 liquidIsotope : function(selector, callback) { 984 jQuery(selector).each(function() { 985 986 var $this = jQuery(this), 987 maxColNum = $this.attr('data-value'), 988 isoBrick = jQuery('.isobrick'), 989 $body = $('body'), 990 $colnum2, 991 $colWidth; 992 993 // Remove margins 994 isoBrick.css({ 995 'margin-left': 0, 996 'margin-right': 0 997 }); 998 999 1000 /** 1001 * Sets column number depending on window width 1002 */ 1003 function setColNum() { 1004 var w = $(window).width(), 1005 columnNum = 1; 1006 1007 if (w > 1200) { 1008 columnNum = 5; 1009 } else if (w > 900) { 1010 columnNum = 4; 1011 } else if (w > 600) { 1012 columnNum = 3; 1013 } else if (w > 300) { 1014 columnNum = 2; 1015 } 1016 1017 return columnNum; 1018 } 1019 1020 1021 /**
1022 * Gets column number and divides to get column width 1023 * @return {integer} Width of column in pixels 1024 */ 1025 function getColWidth(){ 1026 var w = $(window).width(), 1027 columnNum = setColNum(), 1028 colWidth = Math.floor(w/columnNum); 1029 1030 return colWidth; 1031 } 1032 1033 1034 /** 1035 * Sets dynamic size of isotope brick 1036 * @var brick selector 1037 */ 1038 function setBrickSize($isobrick) { 1039 var colWidth = getColWidth(); 1040 1041 // Set width of each brick 1042 $this.find('.isobrick').each(function(){ 1043 var $brick = $(this), 1044 $brickphoto = $brick.find('.postphoto'); 1045 1046 if ($brick.hasClass('big')) { 1047 $brickphoto.css({ 1048 'width' : ((colWidth*2)-4) + 'px', 1049 'min-height' : (((colWidth*2)-4) * 0.7566) + 'px' 1050 }); 1051 } else if ($brick.hasClass('slim')) { 1052 $brickphoto.css( { 1053 'width' : (colWidth-4) + 'px', 1054 'min-height' : ((colWidth-4) * 0.5) + 'px' 1055 }); 1056 } else { 1057 $brickphoto.css( { 1058 'width' : (colWidth-4) + 'px', 1059 'min-height' : ((colWidth-4) * 1.01063) + 'px' 1060 }); 1061 } 1062 1063 1064 }); 1065 } 1066 1067 1068 /** 1069 * Runs isotope script 1070 * @return {void} 1071 */ 1072 function callIsotope($itemContainer) { 1073 var colWidth = getColWidth(); 1074 if (maxColNum != '1') { 1075 $itemContainer.isotope({ 1076 resizable: false, // disable window resizing 1077 masonry: { 1078 columnWidth: colWidth 1079 }, 1080 itemSelector : '.isobrick', 1081 layoutMode : 'masonry' 1082 }, function() { 1083 $('body').matchHeight(); 1084 }); 1085 1086 // In case it fires too soon due to css3 animations 1087 $itemContainer.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(){ 1088 if ($itemContainer.hasClass('isotope')) { 1089 $itemContainer.isotope('reLayout'); 1090 } 1091 }); 1092 } 1093 } 1094 1095 1096 /** 1097 * Runs infinite scroll 1098 * @return {void} 1099 */ 1100 function infiniteScroll($selector) { 1101 /** 1102 * Run infinite scroll 1103 */ 1104 $selector.infinitescroll({ 1105 navSelector : '.more-posts', // selector for the paged navigation 1106 nextSelector : '.more-posts a', // selector for the NEXT link (to page 2) 1107 itemSelector : '.isobrick', // selector for all items you'll retrieve 1108 loading: { 1109 finishedMsg: '', 1110 //img: agAjax.get_template_directory_uri + '/images/loader-horizontal.gif', 1111 msgText: '' 1112 } 1113 }, 1114 1115 // re-call Isotope as a callback 1116 function( newElements ) { 1117 console.log(newElements); 1118 var $newElements = $(newElements); 1119 1120 // Fade in more posts button again 1121 $('.more-posts').fadeIn(500); 1122 1123 /** 1124 * Prepare new elements before insertion 1125 * @return {void} 1126 */ 1127 $newElements.each(function(){ 1128 var $brick = $(this), 1129 $brickphoto = $brick.find('.postphoto'); 1130 1131 // Reset margins 1132 $brick.css({ 1133 'margin-left': 0, 1134 'margin-right': 0 1135 }); 1136 1137 setBrickSize($brickphoto); 1138 }); 1139 1140 // Create slider(s) before insertion 1141 $(newElements).addClass('inserted'); 1142 themewichSlider.createSlider('.inserted ul.bxslider'); 1143 $(newElements).removeClass('inserted'); 1144 1145 /** 1146 * Append content to isotope container 1147 * @return {void} 1148 */ 1149 $selector.isotope( 'insert', $newElements, function(){ 1150 // Add ajaxify script again 1151 if ($.fn.ajaxify) { 1152 $body.ajaxify(); 1153 } 1154 $body.matchHeight(); 1155 $body.themewichHovers(); 1156 $selector.isotope('reLayout'); 1157 }); 1158 } 1159 ); 1160 1161 // kill scroll binding for manual clicking of button 1162 $(window).unbind('.infscr'); 1163 1164 $('.more-posts a').click(function(){ 1165 $(document).trigger('retrieve.infscr'); 1166 $selector.infinitescroll('retrieve'); 1167 return false; 1168 }); 1169 1170 $(document).ajaxError(function(e,xhr,opt){ 1171 if(xhr.status==404) { 1172 $('.more-posts a').remove(); 1173 } 1174 }); 1175 1176 1177 if (callback && typeof(callback) === "function") { 1178 callback(); 1179 } 1180 } 1181 1182 1183 /** 1184 * Filters items when clicked 1185 * @return {void} 1186 */ 1187 function filterSelector($isocontainer) { 1188 $('#filters a, a.filtersort').click(function(e){ 1189 e.preventDefault(); 1190 $('#filters a').removeClass("active"); 1191 1192 var $selector = $(this).attr('data-filter'); 1193 1194 $('#filters a').each(function() { 1195 var $filterselect = $(this).attr('data-filter'); 1196 if ($filterselect == $selector){ 1197 $(this).addClass("active"); 1198 } 1199 }); 1200 1201 $isocontainer.isotope({ filter: $selector }); 1202 1203 }); 1204 } 1205 1206 1207 /** 1208 * Runs isotope script 1209 * @return {void} 1210 */ 1211 function callMasonry($brick) { 1212 // Set brick size 1213 setBrickSize($brick); 1214 // Run isotope 1215 callIsotope($this); 1216 } 1217 1218 1219 /** 1220 * Call scripts on load 1221 */ 1222 callMasonry($this.find('.isobrick')); 1223 infiniteScroll($this); 1224 filterSelector($this); 1225 1226 1227 /** 1228 * Call masonry on resize 1229 */ 1230 $(window).resize(function(){ 1231 callMasonry(); 1232 }); 1233 1234 }); 1235 }, 1236 1237 1238 /** 1239 * Regular fixed-column isotope 1240 * @param {string} selector Container selector 1241 * @param {Function} callback Callback function 1242 * @since v1.0 1243 * (c) Copyright 2013 Andre Gagnon - http://themewich.com 1244 */ 1245 loadIsotope : function(selector, callback) { 1246 1247 jQuery(selector).each(function() { 1248 1249 var $this = $(this), 1250 columnNumber = $this.attr('data-value'), 1251 isoBrick = $('.isobrick'), 1252 $body = $('body'), 1253 $colnum2; 1254 1255 // Remove margins 1256 isoBrick.css({ 1257 'margin-left': 0, 1258 'margin-right': 0 1259 }); 1260 1261 1262 /** 1263 * Get column number 1264 */ 1265 function findColNum() { 1266 // Get column number 1267 if ($this.width() < 500 ) { 1268 $colnum2 = 2; 1269 } else { 1270 $colnum2 = columnNumber; 1271 } 1272 } 1273 1274 1275 /** 1276 * Sets dynamic size of isotope brick 1277 * @var brick selector 1278 */ 1279 function setBrickSize($isobrick) { 1280 1281 var columnWidth = $this.width() / $colnum2 1282 1283 // Set width of each brick 1284 $isobrick.each(function(){ 1285 var $brick = $(this), 1286 $brickphoto = $brick.find('.postphoto'); 1287 1288 if ($brick.hasClass('big')) { 1289 $brickphoto.css({ 1290 'min-height' : (((columnWidth*2)-4) * 0.7566) + 'px' 1291 }); 1292 } else if ($brick.hasClass('slim')) { 1293 $brickphoto.css( { 1294 'min-height' : ((columnWidth-4) * 0.5) + 'px' 1295 }); 1296 } else { 1297 $brickphoto.css( { 1298 'min-height' : ((columnWidth-4) * 1.01063) + 'px' 1299 }); 1300 } 1301 1302 }); 1303 } 1304 1305 1306 /** 1307 * Run isotope plugin 1308 */ 1309 function callIsotope() { 1310 // Call isotope with selected columns 1311 if (columnNumber != '1') { 1312 $this.isotope({ 1313 masonry: { 1314 columnWidth: $this.width() / $colnum2 1315 }, 1316 itemSelector : '.isobrick', 1317 layoutMode : 'masonry' 1318 }, function() { 1319 $('body').matchHeight(); 1320 }); 1321 } 1322 } 1323 1324 1325 /** 1326 * Runs infinite scroll 1327 * @return {void} 1328 */ 1329 function infiniteScroll($selector) { 1330 /** 1331 * Run infinite scroll 1332 */ 1333 $selector.infinitescroll({ 1334 navSelector : '.more-posts', // selector for the paged navigation 1335 nextSelector : '.more-posts a', // selector for the NEXT link (to page 2) 1336 itemSelector : '.isobrick', // selector for all items
1336you'll retrieve 1337 loading: { 1338 finishedMsg: '', 1339 img: agAjax.get_template_directory_uri + '/images/loader-horizontal.gif', 1340 msgText: '' 1341 } 1342 }, 1343 1344 // re-call Isotope as a callback 1345 function( newElements ) { 1346 1347 var $newElements = $(newElements); 1348 1349 // Fade in more posts button again 1350 $('.more-posts').fadeIn(500); 1351 1352 /** 1353 * Prepare new elements before insertion 1354 * @return {void} 1355 */ 1356 $newElements.each(function(){ 1357 var $brick = $(this), 1358 $brickphoto = $brick.find('.postphoto'); 1359 1360 // Reset margins 1361 $brick.css({ 1362 'margin-left': 0, 1363 'margin-right': 0 1364 }); 1365 1366 setBrickSize($brickphoto); 1367 }); 1368 1369 // Create slider(s) before insertion 1370 $(newElements).addClass('inserted'); 1371 themewichSlider.createSlider('.inserted ul.bxslider'); 1372 $(newElements).removeClass('inserted'); 1373 1374 /** 1375 * Append content to isotope container 1376 * @return {void} 1377 */ 1378 $selector.isotope( 'insert', $newElements, function(){ 1379 // Add ajaxify script to new items 1380 if ($.fn.ajaxify) { 1381 $body.ajaxify(); 1382 } 1383 $body.matchHeight(); 1384 $body.themewichHovers(); 1385 $selector.isotope('reLayout'); 1386 }); 1387 } 1388 ); 1389 1390 // kill scroll binding for manual clicking of button 1391 $(window).unbind('.infscr'); 1392 1393 $('.more-posts a').click(function(){ 1394 $(document).trigger('retrieve.infscr'); 1395 $selector.infinitescroll('retrieve'); 1396 return false; 1397 }); 1398 1399 $(document).ajaxError(function(e,xhr,opt){ 1400 if(xhr.status==404) { 1401 $('.more-posts a').remove(); 1402 } 1403 }); 1404 1405 1406 if (callback && typeof(callback) === "function") { 1407 callback(); 1408 } 1409 } 1410 1411 1412 /** 1413 * Call isotope functions in correct order 1414 */ 1415 function runIsotope() { 1416 1417 // Call Functions 1418 findColNum(); 1419 setBrickSize($this.find('.isobrick')); 1420 callIsotope(); 1421 1422 // In case it fires too soon due to css3 animations 1423 $this.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(){ 1424 if ($this.hasClass('isotope')) { 1425 $this.isotope('reLayout'); 1426 } 1427 }); 1428 } 1429 1430 1431 /** 1432 * Run Isotope on load 1433 */ 1434 runIsotope(); 1435 infiniteScroll($this); 1436 1437 /** 1438 * Run Isotope on Resize Event 1439 */ 1440 $(window).resize(function () { 1441 runIsotope(); 1442 }); 1443 1444 1445 /** 1446 * Filter link when clicked 1447 * @return false 1448 */ 1449 $('#filters a, a.filtersort').click(function(){ 1450 $('#filters a').removeClass("active"); 1451 1452 var $selector = $(this).attr('data-filter'); 1453 1454 $('#filters a').each(function() { 1455 var $filterselect = $(this).attr('data-filter'); 1456 if ($filterselect == $selector){ 1457 $(this).addClass("active"); 1458 } 1459 }); 1460 1461 $this.isotope({ filter: $selector }); 1462 return false; 1463 }); 1464 1465 // Callback 1466 if (callback && typeof(callback) === "function") { 1467 callback(); 1468 } 1469 1470 }); // End Each 1471 1472 } 1473 } 1474 } 1475 1476 1477 /** 1478 * Mobile Nav Helper 1479 * Nav works without this function, this just helps user experience 1480 * @since v1.0 1481 * (c) Copyright 2013 Andre Gagnon - http://themewich.com 1482 */ 1483 $.fn.mobileNav = function() { 1484 1485 var $linkslist = $('div.mobilenavigation:first #mobilenav a'); 1486 1487 function hideMenu() { 1488 $('html, body').stop().animate({scrollTop: 0}, 500, 'easeOutCubic'); 1489 $linkslist.removeClass('display'); 1490 } 1491 1492 function showMenu(selector) { 1493 var $this = $(selector); 1494 1495 var offset = $this.offset().top; 1496 $('html, body').stop().animate({scrollTop:offset}, 500, 'easeOutCubic'); 1497 1498 $linkslist.addClass('display'); 1499 } 1500 1501 1502 $(".scroll").click(function(event){ 1503 showMenu('.mobilenavcontainer'); 1504 event.preventDefault(); 1505 }); 1506 $(".menutop").click(function(event){ 1507 hideMenu(); 1508 event.preventDefault(); 1509 }); 1510 $("#mobilenav .menu-item a").click(function(event){ 1511 hideMenu(); 1512 }); 1513 1514 } 1515 1516 /** 1517 * Scroll to top function 1518 * @param {string} selector Top selector 1519 * @since v1.0 1520 * (c) Copyright 2013 Andre Gagnon - http://themewich.com 1521 */ 1522 $.fn.scrollToTop = function() { 1523 1524 var selector = this, 1525 scroll_pos_test = 50; 1526 1527 $(window).scroll(function () { 1528 1529 var y_scroll_pos = window.pageYOffset, 1530 windowWidth = $(window).width(); 1531 1532 if(y_scroll_pos > scroll_pos_test && windowWidth >= 1130) { 1533 $(selector).fadeIn(500); 1534 $('.iphone').children(selector).css('display', 'none !important'); 1535 } else { 1536 $(selector).fadeOut(500); 1537 } 1538 1539 }); 1540 1541 $(selector).click(function(e){ 1542 $('html, body').animate({scrollTop:0}, 500, 'easeOutCubic'); 1543 e.preventDefault(); 1544 return false;
1545 }); 1546 1547 } 1548 1549 /** 1550 * Hover Helper 1551 * @param {string} selector Top selector 1552 * @since v1.0 1553 * (c) Copyright 2013 Andre Gagnon - http://themewich.com 1554 */ 1555 $.fn.themewichHoverHelper = function() { 1556 var $this = $(this), 1557 $hoverHelper = $('p.hoverhelper').css('opacity', 0).empty(); 1558 1559 $this.each(function(){ 1560 $(this).hover( function() { 1561 var $hovertext = $(this).text(); 1562 $hoverHelper.stop().animate({opacity : 0}, 500, 'easeOutCubic', function() { 1563 $hoverHelper.empty().text($hovertext).stop().animate({opacity : 1}, 500, 'easeOutCubic'); 1564 }); 1565 1566 }, function() { 1567 $hoverHelper.stop().animate({opacity : 0}, 500, 'easeOutCubic'); 1568 }); 1569 }); 1570 } 1571 1572 /** 1573 * Video Wrap Helper 1574 * @since v1.0 1575 * (c) Copyright 2013 Andre Gagnon - http://themewich.com 1576 */ 1577 $.fn.addVideoWrap = function() { 1578 $('.fluid-width-video-wrapper').wrap('<div class="fixed">'); 1579 } 1580 1581 /** 1582 * Height Helper 1583 * @param {string} selector element selector 1584 * @since v1.0 1585 * (c) Copyright 2013 Andre Gagnon - http://themewich.com 1586 */ 1587 $.fn.heightHelper = function() { 1588 var h = ''; 1589 $(this).each(function(){ 1590 var $this = $(this), 1591 w = $(this).width(); 1592 if ($this.closest('.isobrick').hasClass('big')) { 1593 h = w * 0.7566; 1594 } else if ($this.hasClass('slim')) { 1595 h = w * 0.5; 1596 } else { 1597 h = w * 1.01063; 1598 } 1599 $this.css({'min-height' : h+'px'}).attr('data-height', h); 1600 }); 1601 } 1602 1603 1604 /** 1605 * Initialize all scripts here 1606 * 1607 * Comment out script lines to remove functionality 1608 */ 1609 $.fn.themewichScripts = function(){ 1610 1611 // Run theme plugins 1612 if ($.fn.magnificPopup) { 1613 $('body').themewichLightbox(); 1614 } 1615 if ($.fn.fitVids) { 1616 $('body').fitVids(); 1617 } 1618 if ($.fn.superfish) { 1619 $('ul.sf-menu').superfish({ cssArrows: true }); 1620 } 1621 if ($.fn.validate) { 1622 $("#contactform").validate(); 1623 $("#quickform").validate(); 1624 $("#commentsubmit").validate(); 1625 } 1626 if ($.fn.themewichTabs) { 1627 $('ul.tabs').themewichTabs(); 1628 } 1629 if ($.fn.bxSlider && $('ul.bxslider').length) { 1630 themewichSlider.createSlider('ul.bxslider'); 1631 } 1632 if ($.fn.isotope) { 1633 if ($('.isotopecontainer').length) { 1634 themewichIsotope.loadIsotope('.isotopecontainer'); 1635 } 1636 if ($('.isotopeliquid').length) { 1637 themewichIsotope.liquidIsotope('.isotopeliquid'); 1638 } 1639 } 1640 1641 // Run the theme-specific functions 1642 $('img.parallaximg').parallaxImg(); 1643 $('.top-nav').themewichStickyNav(); 1644 $('body').addVideoWrap(); 1645 $('body').mobileNav(); 1646 $('.top').scrollToTop(); 1647 $('.controls a').themewichHoverHelper(); 1648 } 1649 1650 $(document).ready(function() { 1651 $('body').themewichScripts(); 1652 }); 1653})(jQuery);
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.