1var min_w = 1500; // minimum video width allowed 2var video_width_original = 1280; // original video dimensions 3var video_height_original = 720; 4var vid_ratio = 1280/720; 5 6jQuery(document).ready(function($){ 7 8 /* ------------------------------------------------------------------------ */ 9 /* Accordion */ 10 /* ------------------------------------------------------------------------ */ 11 12 $('.accordion').each(function(){ 13 var acc = $(this).attr("rel") * 2; 14 $(this).find('.accordion-inner:nth-child(' + acc + ')').show(); 15 $(this).find('.accordion-inner:nth-child(' + acc + ')').prev().addClass("active"); 16 }); 17 18 $('.accordion .accordion-title').click(function() { 19 if($(this).next().is(':hidden')) { 20 $(this).parent().find('.accordion-title').removeClass('active').next().slideUp(200); 21 $(this).toggleClass('active').next().slideDown(200); 22 } 23 return false; 24 }); 25 26 /* ------------------------------------------------------------------------ */ 27 /* Alert Messages */ 28 /* ------------------------------------------------------------------------ */ 29 30 $(".alert-message .close").click(function(){ 31 $(this).parent().animate({'opacity' : '0'}, 300).slideUp(300); 32 return false; 33 }); 34 35 /* ------------------------------------------------------------------------ */ 36 /* Skillbar */ 37 /* ------------------------------------------------------------------------ */ 38 39 $('.skillbar').each(function(){ 40 dataperc = $(this).attr('data-perc'), 41 $(this).find('.skill-percentage').animate({ "width" : dataperc + "%"}, dataperc*20); 42 }); 43 44 /* ------------------------------------------------------------------------ */ 45 /* Tabs */ 46 /* ------------------------------------------------------------------------ */ 47 48 $('div.tabset').tabset(); 49 50 /* ------------------------------------------------------------------------ */ 51 /* Toggle */ 52 /* ------------------------------------------------------------------------ */ 53 54 if( $(".toggle .toggle-title").hasClass('active') ){ 55 $(".toggle .toggle-title.active").closest('.toggle').find('.toggle-inner').show(); 56 } 57 58 $(".toggle .toggle-title").click(function(){ 59 if( $(this).hasClass('active') ){ 60 $(this).removeClass("active").closest('.toggle').find('.toggle-inner').slideUp(200); 61 } 62 else{ 63 $(this).addClass("active").closest('.toggle').find('.toggle-inner').slideDown(200); 64 } 65 }); 66 67 /* ------------------------------------------------------------------------ */ 68 /* Video Background 69 /* ------------------------------------------------------------------------ */ 70 71 vid_w_orig = parseInt($('video').attr('width')); 72 vid_h_orig = parseInt($('video').attr('height')); 73 74 $(window).resize(function () { resizeToCover(); }); 75 $(window).trigger('resize'); 76 77 function resizeToCover() { 78 79 $('.videosection .video-wrap').each(function(i){ 80 81 var $sectionWidth = $(this).closest('.videosection').outerWidth(); 82 var $sectionHeight = $(this).closest('.videosection').outerHeight(); 83 84 $(this).width($sectionWidth); 85 $(this).height($sectionHeight); 86 87 // calculate scale ratio 88 var scale_h = $sectionWidth / video_width_original; 89 var scale_v = $sectionHeight / video_height_original; 90 var scale = scale_h > scale_v ? scale_h : scale_v; 91 92 // limit minimum width 93 min_w = vid_ratio * ($sectionHeight+20); 94 95 if (scale * video_width_original < min_w) {scale = min_w / video_width_original;} 96 97 $(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * video_width_original +2)); 98 $(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * video_height_original +2)); 99 100 $(this).scrollLeft(($(this).find('video').width() - $sectionWidth) / 2); 101 102 $(this).find('.mejs-overlay, .mejs-poster').scrollTop(($(this).find('video').height() - ($sectionHeight)) / 2); 103 $(this).scrollTop(($(this).find('video').height() - ($sectionHeight)) / 2); 104 105 }); 106 107 } // end resizetocover 108 109/* EOF document.ready */ 110}); 111 112/* Tabset Function ---------------------------------- */ 113(function ($) { 114$.fn.tabset = function () {
115 var $tabsets = $(this); 116 $tabsets.each(function (i) { 117 var $tabs = $('li.tab a', this); 118 $tabs.click(function (e) { 119 var $this = $(this); 120 panels = $.map($tabs, function (val, i) { 121 return $(val).attr('href'); 122 }); 123 $(panels.join(',')).hide(); 124 $tabs.removeClass('selected'); 125 $this.addClass('selected').blur(); 126 $($this.attr('href')).show(); 127 e.preventDefault(); 128 return false; 129 }).first().triggerHandler('click'); 130 }); 131}; 132})(jQuery); 133 134/* ------------------------------------------------------------------------ */ 135/* EOF */ 136/* ------------------------------------------------------------------------ */
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.