1//resCarousel 2 3 4$(document).ready(function(){ 5var itemsMainDiv = ('.resCarousel'); 6var itemsDiv = ('.resCarousel-inner'); 7var itemWidth = ""; 8 9 $('.leftLst, .rightLst').click(function () { 10 var condition = $(this).hasClass("leftLst"); 11 if(condition) 12 click(0,this); 13 else 14 click(1,this) 15 }); 16 17 ResCarouselSize(); 18 19 20 21 22$(window).resize(function() { 23 ResCarouselSize(); 24}); 25 26//this function define the size of the items 27function ResCarouselSize() 28{ 29 var incno = 0; 30 var dataItems = ("data-items"); 31 var itemClass = ('.item'); 32 var id = 0; 33 var btnParentSb = ''; 34 var itemsSplit = ''; 35 var sampwidth = $(itemsMainDiv).width(); 36 var bodyWidth = $('body').width(); 37 $(itemsDiv).each(function() { 38 id=id+1; 39 var itemNumbers = $(this).find(itemClass).length; 40 btnParentSb = $(this).parent().attr(dataItems); 41 itemsSplit = btnParentSb.split(','); 42 $(this).parent().attr("id","ResSlid"+id); 43 44 45 if(bodyWidth>=1200) 46 { 47 incno=itemsSplit[3]; 48 itemWidth = sampwidth/incno; 49 } 50 else if(bodyWidth>=992) 51 { 52 incno=itemsSplit[2]; 53 itemWidth = sampwidth/incno; 54 } 55 else if(bodyWidth>=768) 56 { 57 incno=itemsSplit[1]; 58 itemWidth = sampwidth/incno; 59 } 60 else 61 { 62 incno=itemsSplit[0]; 63 itemWidth = sampwidth/incno; 64 } 65 $(this).css({'transform':'translateX(0px)','width':itemWidth*itemNumbers}); 66 $(this).find(itemClass).each(function(){ 67 $(this).outerWidth(itemWidth);
68 }); 69 70 $(".leftLst").addClass("outt"); 71 $(".rightLst").removeClass("outt"); 72 73 }); 74} 75 76 77//this function used to move the items 78function ResCarousel(e, el, s){ 79 var leftBtn = ('.leftLst'); 80 var rightBtn = ('.rightLst'); 81 var translateXval = ''; 82 var divStyle = $(el+' '+itemsDiv).css('transform'); 83 var values = divStyle.match(/-?[\d\.]+/g); 84 var xds = Math.abs(values[4]); 85 var IW = $(el).find('.item').outerWidth(); 86 //alert(IW*s); 87 88 if(e==0){ 89 translateXval = parseInt(xds)-parseInt(IW*s); 90 $(el+' '+rightBtn).removeClass("outt"); 91 92 93 if(translateXval<= IW/2){ 94 translateXval = 0; 95 $(el+' '+leftBtn).addClass("outt"); 96 } 97 } 98 else if(e==1){ 99 var itemsCondition = $(el).find(itemsDiv).width()-$(el).width(); 100 translateXval = parseInt(xds)+parseInt(IW*s); 101 $(el+' '+leftBtn).removeClass("outt"); 102 103 if(translateXval>= itemsCondition-IW/2){ 104 translateXval = itemsCondition; 105 $(el+' '+rightBtn).addClass("outt"); 106 } 107 } 108 $(el+' '+itemsDiv).css('transform','translateX('+-translateXval+'px)'); 109} 110 111//It is used to get some elements from btn 112function click(ell,ee){ 113 var Parent ="#"+$(ee).parent().attr("id"); 114 var slide = $(Parent).attr("data-slide"); 115 ResCarousel(ell, Parent, slide); 116} 117 118});
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.