1/** 2 * Flatten height same as the highest element for each row. 3 * 4 * Copyright (c) 2011 Hayato Takenaka 5 * Dual licensed under the MIT and GPL licenses: 6 * http://www.opensource.org/licenses/mit-license.php 7 * http://www.gnu.org/licenses/gpl.html 8 * @author: Hayato Takenaka (https://github.com/urin/jquery.tile.js) 9 * @version: 1.1.1 10 **/ 11(function($) { 12 $.fn.tile = function(columns) { 13 var tiles, $tile, max, c, h, remove, s = document.body.style, a = ["height"], 14 last = this.length - 1; 15 if(!columns) columns = this.length; 16 remove = s.removeProperty ? s.removeProperty : s.removeAttribute; 17 return this.each(function() { 18 remove.apply(this.style, a); 19 }).each(function(i) { 20 c = i % columns; 21 if(c == 0) tiles = []; 22 $tile = tiles[c] = $(this); 23 h = ($tile.css("box-sizing") == "border-box") ? $tile.outerHeight() : $tile.innerHeight(); 24 if(c == 0 || h > max) max = h; 25 if(i == last || c == columns - 1) { 26 $.each(tiles, function() { this.css("height", max); }); 27 } 28 }); 29 }; 30})(jQuery); 31 32 33 34// tile settings 35//-------------------------------- 36function runAutoHeight(){ 37 38 $('.column-2').each(function(){ 39 $('.border-link-block-A01 figure',this).tile(2); 40 $('.border-link-block-A01 .title > strong',this).tile(2); 41 $('.border-link-block-B01 a',this).tile(2); 42 $('.inner-block > div',this).tile(2); 43 $('.inner-block > a',this).tile(2); 44 }); 45 $('.column-3').each(function(){ 46 $('.border-link-block-A01 figure',this).tile(3); 47 $('.border-link-block-A01 .title > strong',this).tile(3); 48 $('.border-link-block-B01 a',this).tile(3); 49 $('.inner-block > div',this).tile(3); 50 $('.inner-block > a',this).tile(3); 51 $('.inner-block > div .text',this).tile(3); 52 }); 53 $('.column-4').each(function(){ 54 $('.border-link-block-A01 figure',this).tile(4); 55 $('.border-link-block-A01 .title > strong',this).tile(4); 56 $('.border-link-block-B01 a',this).tile(4); 57 $('.inner-block > div',this).tile(4); 58 $('.inner-block > a',this).tile(4); 59 }); 60 $('.column-5').each(function(){ 61 $('.card-box-3 .heading',this).tile(5); 62 $('.card-box-3 > *[class^="text-link"]',this).tile(5); 63 $('*[class^="card-box"]',this).tile(5); 64 $('.inner-block > div',this).tile(5); 65 $('.inner-block > a',this).tile(5); 66 }); 67 $('.column-6').each(function(){ 68 $('.card-box-3 .heading',this).tile(6); 69 $('.card-box-3 > *[class^="text-link"]',this).tile(6); 70 $('*[class^="card-box"]',this).tile(6); 71 $('.inner-block > div',this).tile(6); 72 $('.inner-block > a',this).tile(6); 73 }); 74 75 if(($(window).width())<767 && !$('html').hasClass('ie8')){ 76 $('.sp-column-2').each(function(){$('.col',this).tile(2);}); 77 $('.sp-column-3').each(function(){$('.col',this).tile(3);}); 78 } 79 80 /*top*/ 81 $('.topPage').each(function(){ 82 $('.card-block-01 .column-2 > div .read').tile(2); 83 $('.card-block-01 .column-2 > div .btn').tile(2); 84 $('.news-block-01 .column-3 > div').tile(3); 85 }); 86} 87 88 89// reset tile 90//-------------------------------- 91function resetAutoHeight(){ 92 $('.border-link-block-A01 figure').removeAttr('style'); 93 $('.border-link-block-A01 .title > strong').removeAttr('style'); 94 $('.border-link-block-B01 a').removeAttr('style'); 95 $('.inner-block > div').removeAttr('style'); 96 $('.inner-block > a').removeAttr('style'); 97 $('.inner-block > div .text').removeAttr('style'); 98 $('*[class^="sp-column-"] .col').removeAttr('style'); 99 100 $('.card-block-01 .column-2 > div .read').removeAttr('style'); 101 $('.card-block-01 .column-2 > div .btn').removeAttr('style'); 102 $('.news-block-01 .column-3 > div').removeAttr('style'); 103} 104 105 106// load event 107//-------------------------------- 108$(window).load(function(){ 109 runAutoHeight() 110}); 111 112// Window Resize Event 113//-------------------------------- 114(function(){ 115 var $timer = false; 116 $(window).resize(function() { 117 if ($timer !== false) { 118 clearTimeout($timer); 119 } 120 $timer = setTimeout(function(){ 121 if(parseInt($(window).width())<767 && !$('html').hasClass('ie8')){ 122 resetAutoHeight(); 123 }else{ 124 resetAutoHeight(); 125 runAutoHeight(); 126 } 127 }, 200); 128 }); 129})();
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.