1jQuery(document).ready(function($) { 2 3 // ------------------------------------------------------------------------------ // 4 // DDsmooth Drop-Down Menu // 5 // ------------------------------------------------------------------------------ // 6 7 (function() { 8 9 ddsmoothmenu.init({ 10 mainmenuid: "navigation", //menu DIV id 11 orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v" 12 classname: 'ddsmoothmenu', //class added to menu's outer DIV 13 contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"] 14 }); 15 16 })(); 17 18 19 // ------------------------------------------------------------------------------ // 20 // Responsive Menu // 21 // ------------------------------------------------------------------------------ // 22 23 (function() { 24 25 function initMenu () { 26 $("#main-menu").tinyNav({ 27 active: 'selected', // String: Set the "active" class 28 header: 'Navigate to...' // String: Specify text for "header" and show header instead of the active item 29 }); 30 } 31 32 initMenu(); 33 34 })(); 35 36 37 // ------------------------------------------------------------------------------ // 38 // Content Slider Navigation Effect // 39 // ------------------------------------------------------------------------------ // 40 41 (function() { 42 43 $('#content-slider-nav a:eq(0)').addClass('active'); 44 $('#content-slider-nav .tab-slider-inner-wrapper').append('<div id="active-indicator"> </div>'); 45 46 $('#content-slider-nav a').click(function(event){ 47 event.preventDefault(); 48 if( !$(this).hasClass('active') ){ 49 $('#content-slider-nav a').removeClass('active'); 50 $(this).addClass('active'); 51 52 var linkPos = $(this).position(); 53 54 $('#active-indicator').animate({ 55 left: linkPos.left - 16 56 }); 57 } 58 }); 59 60 })(); 61 62 63 // ------------------------------------------------------------------------------ // 64 // Equalize the Heights of Elements. // 65 // ------------------------------------------------------------------------------ // 66 67 (function() { 68 69 $.fn.equalHeights = function(minHeight, maxHeight) { 70 tallest = (minHeight) ? minHeight : 0; 71 this.each(function() { 72 if($(this).height() > tallest) { 73 tallest = $(this).height(); 74 } 75 }); 76 if((maxHeight) && tallest > maxHeight) tallest = maxHeight; 77 return this.each(function() { 78 $(this).css({'height': tallest}); 79 }); 80 } 81 82 // Set Custom Blocks Max Height // 83 //---------------------------------------------------------------- // 84 var port_item_holder = $('.custom-blocks .block .equal-box'); 85 port_item_holder.equalHeights(); 86 87 $(window).resize(function(){ 88 port_item_holder.css('height','auto'); 89 port_item_holder.equalHeights(); 90 }); 91 92 93 // Set Icon Box Max Height // 94 //---------------------------------------------------------------- // 95 var ib_container = $('.icon-box.framed-box'); 96 ib_container.equalHeights(); 97 98 $(window).resize(function(){ 99 ib_container.css('height','auto'); 100 ib_container.equalHeights(); 101 }); 102 103 })(); 104 105 106 // ------------------------------------------------------------------------------ // 107 // Team Member Hover Effect // 108 // ------------------------------------------------------------------------------ // 109 110 (function() { 111 112 function memberHover() { 113 $(".member-profile").hover(function () { 114 $('.info', this).css({display: "none"}).slideDown('slow'); 115 }, function () { 116 $('.info', this).css({display: "none"}); 117 }); 118 return false; 119 } 120 121 memberHover(); 122 123 })(); 124 125 126 // ------------------------------------------------------------------------------ // 127 // Icon Box Hover Effect // 128 // ------------------------------------------------------------------------------ // 129 130 (function() { 131 132 var $container = $('.ib-container'), 133 $articles = $('.ib-container .icon-box'), 134 timeout; 135 136 $articles.on( 'mouseenter', function( event ) { 137 var $article = $(this); 138 clearTimeout( timeout ); 139 timeout = setTimeout( function() { 140 if( $article.hasClass('active') ) return false; 141 142 $articles.not( $article.removeClass('blur').addClass('active') ) 143 .removeClass('active') 144 .addClass('blur'); 145 }, 65 ); 146 }); 147 148 $container.on( 'mouseleave', function( event ) { 149 clearTimeout( timeout ); 150 $articles.removeClass('active blur'); 151 }); 152 153 })(); 154 155 156 // ------------------------------------------------------------------------------ // 157 // FitVids // 158 // ------------------------------------------------------------------------------ // 159 160 (function() { 161 162 $(".container").fitVids(); 163 164 })(); 165 166 167 // ------------------------------------------------------------------------------ // 168 // Alert Boxes // 169 // ------------------------------------------------------------------------------ // 170 171 (function() { 172 173 function initMessageBoxes() { 174 $('.message-box .close').live('click', function() { 175 $(this).parent().parent().fadeTo(400, 0.001).slideUp(); 176 }); 177 } 178 179 initMessageBoxes(); 180 181 })(); 182 183 184 // ------------------------------------------------------------------------------ // 185 // Set minimum height to the content so footer will stay at the bottom of the window // 186 // ------------------------------------------------------------------------------ // 187 188 (function() { 189 190 function minHeight() { 191 192 $('#content').css('min-height', 193 $(window).outerHeight(true) - ( $('body').outerHeight(true) - $('body').height() ) - $('#header').outerHeight(true) 194 - ( $('#content').outerHeight(true) - $('#content').height() ) - $('#footer').outerHeight(true) - $('#footer-bottom').outerHeight(true) 195 ); 196 197 } 198 199 minHeight(); 200 201 // Window resize 202 $(window).on('resize', function() { 203 204 var timer = window.setTimeout( function() { 205 window.clearTimeout( timer ); 206 minHeight(); 207 }, 30 ); 208 209 }); 210 211 })(); 212 213 // ------------------------------------------------------------------------------ // 214 // HTML5 Placeholder // 215 // ------------------------------------------------------------------------------ // 216 217 (function() { 218 219 if(!Modernizr.input.placeholder){ 220 221 $('[placeholder]').focus(function() { 222 var input = $(this); 223 if (input.val() == input.attr('placeholder')) { 224 input.val(''); 225 input.removeClass('placeholder'); 226 } 227 }).blur(function() { 228 var input = $(this); 229 if (input.val() == '' || input.val() == input.attr('placeholder')) { 230 input.addClass('placeholder'); 231 input.val(input.attr('placeholder')); 232 } 233 }).blur(); 234 $('[placeholder]').parents('form').submit(function() { 235 $(this).find('[placeholder]').each(function() { 236 var input = $(this); 237 if (input.val() == input.attr('placeholder')) { 238 input.val(''); 239 } 240 }) 241 }); 242 243 } 244 245 })(); 246 247 248 // ------------------------------------------------------------------------------ // 249 // Animated Scroll To Top // 250 // ------------------------------------------------------------------------------ // 251 252 (function() { 253 254 // hide #scroll-top first 255 $("#scroll-top").hide(); 256 257 // fade in #scroll-top 258 $(window).scroll(function () { 259 if ($(this).scrollTop() > 150) { 260 $('#scroll-top').fadeIn(); 261 } else { 262 $('#scroll-top').fadeOut(); 263 } 264 }); 265 266 // scroll body to 0px on click 267 $('#scroll-top a').click(function () { 268 $('body,html').animate({ 269 scrollTop: 0 270 }, 800); 271 return false; 272 }); 273 274 // Divider Top 275 $(".divider a.top").click(function() { 276 $('html, body').animate({scrollTop:0}, 'slow'); 277 return false; 278 }); 279 280 })(); 281 282 283 // ------------------------------------------------------------------------------ // 284 // Twitter Plugin Settings // 285 // ------------------------------------------------------------------------------ // 286 287 (function() { 288 289 var $twitter_name = 'envato'; 290
291 //Content Twitter Count 1 292 $("#content .section-wrap .twitter-wrap, #footer .twitter-wrap").tweet({ 293 username : $twitter_name, 294 count : 1, 295 template : "{join}{text}{time}", 296 loading_text: "Loading tweets..." 297 }).bind("loaded",function(){$(this).find("a").attr("target","_blank");}); 298 299 //Sidebar Twitter Count 2 300 $("#sidebar .twitter-wrap").tweet({ 301 username : $twitter_name, 302 count : 2, 303 template : "{join}{text}{time}", 304 loading_text: "Loading tweets..." 305 }).bind("loaded",function(){$(this).find("a").attr("target","_blank");}); 306 307 })(); 308 309 310 // ------------------------------------------------------------------------------ // 311 // Flickr Plugin Settings // 312 // ------------------------------------------------------------------------------ // 313 314 (function() { 315 316 $('.flickr-wrap').jflickrfeed({ 317 limit: 6, 318 qstrings: { 319 id: '35220169@N04' 320 }, 321 itemTemplate: '<li><a href="{{image_b}}"><img src="{{image_s}}" alt="{{title}}" /></a></li>' 322 }); 323 324 })(); 325 326 327 // ------------------------------------------------------------------------------ // 328 // Google Map Plugin Settings // 329 // ------------------------------------------------------------------------------ // 330 331 (function() { 332 333 $('.google-map').gMap({ 334 markers: [ 335 { 336 address : 'Carrer Nou de Juliol, 18, Ciutadella', 337 html: '_address', 338 title: "envato" 339 } 340 ], 341 address: 'Carrer Nou de Juliol, 18, Ciutadella', 342 zoom: 16, 343 scrollwheel: false 344 }); 345 346 })(); 347 348 349 // ------------------------------------------------------------------------------ // 350 // Portfolio Hover Effect // 351 // ------------------------------------------------------------------------------ // 352 353 function portfolioHover() { 354 355 $('.portfolio-item').hover(function(){ 356 $(".portfolio-icons", this).stop().animate({'bottom': '10px'},{queue:false,duration:300}); 357 }, function() { 358 $(".portfolio-icons", this).stop().animate({'bottom': '-40px'},{queue:false,duration:300}); 359 }); 360 361 // For each image 362 $('.portfolio-item .post-feature').each(function() { 363 // If the image has a class of 'post-feature' and the children element doesn't have a 'mask-overlay' class 364 if($(this).attr('class') == 'post-feature' && $(this).children().attr('class') !== 'mask-overlay') { 365 $(this).css('cursor', 'default') 366 $(this).prepend('<span class="mask-overlay"></span>'); 367 } 368 }); 369 370 $('.portfolio-item').each(function(){ 371 $(this).find('.mask-overlay').css('opacity','0'); 372 $(this).hover(function(){ 373 $(this).find('.mask-overlay').stop().animate({'opacity': 0.2}); 374 }, function(){ 375 $(this).find('.mask-overlay').stop().animate({'opacity': 0}); 376 }); 377 }); 378 379 return false; 380 381 } 382 383 portfolioHover(); 384 385 386 // ------------------------------------------------------------------------------ // 387 // Image Hover Effect // 388 // ------------------------------------------------------------------------------ // 389 390 (function() { 391 392 var $image_hover = $('a.image-icon-zoom, a.image-icon-link, a.image-icon-play, a.image-no-link'); 393 394 $image_hover.each(function(){ 395 396 if ($.browser.msie && parseInt($.browser.version, 10) < 7) {} else { 397 if ($.browser.msie && parseInt($.browser.version, 10) < 9) { 398 $(this).hover(function(){ 399 $(this).find('.image-overlay').css("visibility", "visible"); 400 },function(){ 401 $(this).find('.image-overlay').css("visibility", "hidden"); 402 }).children('img').before('<span class="mask-overlay"></span>').after('<span class="image-overlay"></span>'); 403 } else { 404 $(this).hover(function(){ 405 $(this).find('.image-overlay').stop().animate({ 406 opacity: '1' 407 },"fast"); 408 },function(){ 409 $(this).find('.image-overlay').stop().animate({ 410 opacity: '0' 411 },"fast"); 412 }).children('img').before('<span class="mask-overlay"></span>').after($('<span class="image-overlay"></span>').css({opacity: '0',visibility:'visible'})); 413 } 414 415 $(this).find('.mask-overlay').css('opacity','0'); 416 417 $(this).hover(function(){ 418 $(this).find('.mask-overlay').stop().animate({'opacity': 0.3}); 419 }, function(){ 420 $(this).find('.mask-overlay').stop().animate({'opacity': 0}); 421 }); 422 } 423 }); 424 425 $('.image-no-link').click(function(){ 426 return false; 427 }); 428 429 })(); 430 431 432 // ------------------------------------------------------------------------------ // 433 // prettyPhoto Plugin Settings // 434 // ------------------------------------------------------------------------------ // 435 436 function prettyPhoto() { 437 438 if ($('a.image-icon-zoom').attr('data-rel') == undefined || $('a.image-icon-zoom').attr('data-rel') == '') { 439 $("a.image-icon-zoom").attr("data-rel","prettyPhoto");} 440 441 if ($('a.image-icon-play').attr('data-rel') == undefined || $('a.image-icon-play').attr('data-rel') == '') { 442 $("a.image-icon-play").attr("data-rel","prettyPhoto");} 443 444 $(".portfolio-container > .portfolio-item .post-feature span").children("a.image-hover").attr("data-rel","prettyPhoto[gal]"); 445 446 $(".portfolio-container > .portfolio-item .post-feature span").children("a.video-hover").attr("data-rel","prettyPhoto[gal]"); 447 448 $(".portfolio-container > .portfolio-item .post-feature span").children("a.link-hover").removeAttr("data-rel"); 449 450 $("a.image-no-link").removeAttr("data-rel"); 451 452 $("a[data-rel^='prettyPhoto']").prettyPhoto({ 453 animation_speed: 'fast', // fast/slow/normal 454 opacity: 0.70, // Value between 0 and 1 455 show_title: true, // true/false 456 allow_resize: true, // Resize the photos bigger than viewport. true/false 457 default_width: 500, 458 default_height: 344, 459 theme: 'pp_default', // light_rounded / dark_rounded / light_square / dark_square / facebook 460 overlay_gallery: false, // If set to true, a gallery will overlay the fullscreen image on mouse over 461 deeplinking: false, // Allow prettyPhoto to update the url to enable deeplinking. 462 social_tools: false 463 }); 464 465 return false; 466 } 467 468 prettyPhoto(); 469 470 471 // ------------------------------------------------------------------------------ // 472 // QuickSand plugin Settings // 473 // ------------------------------------------------------------------------------ // 474 475 (function() { 476 477 // Clone applications to get a second collection 478 var $data = $(".portfolio-container").clone(); 479 480 //NOTE: Only filter on the main portfolio page, not on the subcategory pages 481 $('.portfolio-filter a').click(function() { 482 $(".portfolio-filter a").removeClass("selected"); 483 484 // Use the last category class as the category to filter by. This means that multiple categories are not supported (yet) 485 var $filterClass = $(this).attr('id'); 486 487 if ($filterClass == 'all') { 488 var $filteredData = $data.find('.portfolio-item'); 489 } else { 490 var $filteredData = $data.find('.portfolio-item[data-type~=' + $filterClass + ']'); 491 } 492 493 $(".portfolio-container").quicksand($filteredData, {
494 duration: 800, 495 easing: 'easeInOutQuad', 496 adjustHeight: 'dynamic', 497 enhancement: function() { 498 portfolioHover(); 499 prettyPhoto(); 500 } 501 }); 502 503 $(this).addClass("selected"); 504 return false; 505 }); 506 507 })(); 508 509 510 // ------------------------------------------------------------------------------ // 511 // Elements // 512 // ------------------------------------------------------------------------------ // 513 514 515 // Toggles // 516 //---------------------------------------------------------------- // 517 518 (function() { 519 var $toggles = $(".toggle-title"); 520 521 $(".toggle-content").hide(); 522 523 $toggles.toggle(function() { 524 $(this).addClass('toggle-active'); 525 $(this).siblings('.toggle-content').slideDown("fast"); 526 }, 527 function() { 528 $(this).removeClass('toggle-active'); 529 $(this).siblings('.toggle-content').slideUp("fast"); 530 }); 531 532 })(); 533 534 535 // Tabs // 536 //---------------------------------------------------------------- // 537 538 (function() { 539 540 $(".tabs-container").each(function() { 541 var $history = $(this).attr('data-history'); 542 if($history!=undefined && $history == 'true'){ 543 $history = true; 544 }else { 545 $history = false; 546 } 547 var $initialIndex = $(this).attr('data-initialIndex'); 548 if($initialIndex==undefined){ 549 $initialIndex = 0; 550 } 551 $("ul.tabs",this).tabs("div.tab-content > div", {tabs:'a', effect: 'fade', fadeOutSpeed: -200, history: $history, initialIndex: $initialIndex}); 552 }); 553 554 })();
555 556 557 // Accordion // 558 //---------------------------------------------------------------- // 559 560 (function() { 561 562 $(".accordion").each(function() { 563 var $initialIndex = $(this).attr('data-initialIndex'); 564 if($initialIndex==undefined){ 565 $initialIndex = 0; 566 } 567 $(this).tabs("div.accordion-content", {tabs: '.accordion-title', effect: 'slide',initialIndex: $initialIndex}); 568 }); 569 570 })(); 571 572 573 // ------------------------------------------------------------------------------ // 574 // Contact Form // 575 // ------------------------------------------------------------------------------ // 576 577 (function() { 578 579 $('form.contact-form').submit(function() { 580 $('form.contact-form .error').remove(); 581 var hasError = false; 582 $('.requiredField').each(function() { 583 if($.trim($(this).val()) == '') { 584 var labelText = $(this).prev('label').text(); 585 $(this).parent().append('<div class="error">Please enter your '+labelText+'</div>'); 586 hasError = true; 587 } else if($(this).hasClass('email')) { 588 var emailReg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; 589 if(!emailReg.test($.trim($(this).val()))) { 590 var labelText = $(this).prev('label').text(); 591 $(this).parent().append('<div class="error">You entered an invalid '+labelText+'</div>'); 592 hasError = true; 593 } 594 } 595 }); 596 if(!hasError) { 597 $('form.contact-form.submit').fadeOut('normal', function() { 598 $(this).parent().append(''); 599 }); 600 var formInput = $(this).serialize(); 601 $.ajax({
602 type: "POST", 603 url: "contact_form.php", 604 data: formInput, 605 success: function(result) { 606 $('.contact-form').slideUp('slow', function(){ 607 $('div#result').html(result); 608 $('div#result').slideDown('slow'); 609 }); 610 } 611 }); 612 } 613 614 return false; 615 616 }); 617 618 })(); 619 620 621}); 622 623 624$(window).load(function() { 625 626 // ------------------------------------------------------------------------------ // 627 // FlexSlider // 628 // ------------------------------------------------------------------------------ // 629 630 // Home Page Slider // 631 //---------------------------------------------------------------- // 632 $('.home-slider.flexslider').flexslider({ 633 animation: "fade" 634 }); 635 636 // Portfolio Slider / Blog Slider // 637 //---------------------------------------------------------------- // 638 $('.portfolio-slider.flexslider, .blog-slider.flexslider').flexslider({ 639 animation: "fade", 640 controlNav: false, 641 slideshow: false 642 }); 643 644 // Testimonials Slider // 645 //---------------------------------------------------------------- // 646 $('.testimonials-slider.flexslider').flexslider({ 647 animation: "slide", 648 controlNav: false, 649 smoothHeight: true, 650 slideshow: false 651 }); 652 653 654 // ------------------------------------------------------------------------------ // 655 // Content Slides Slider // 656 // ------------------------------------------------------------------------------ // 657 658 $('.content-slider').slides({ 659 effect: 'fade', 660 crossfade: false, 661 generatePagination: false, 662 autoHeight: true, 663 fadeSpeed: 200 664 }); 665 666 667});
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.