1(function($) { 2 "use strict"; 3 4$(document).ready(function() { 5 6 7 $(".owl-demo>.owl-carousel").owlCarousel({ 8 autoPlay : 12000, 9 stopOnHover : true, 10 lazyLoad : true, 11 pagination:true, 12 singleItem : true, 13 }); 14 15 $(".owl-demo2>.owl-carousel").owlCarousel({ 16 autoPlay : 5000, 17 stopOnHover : true, 18 navigation: false, 19 paginationSpeed : 1000, 20 goToFirstSpeed : 2000, 21 singleItem : true, 22 autoHeight : true, 23 transitionStyle:"fade" 24 }); 25 26 $(".owl-demo3>.owl-carousel").owlCarousel({ 27 autoPlay : 5000, 28 stopOnHover : true, 29 navigation: false, 30 paginationSpeed : 1000, 31 goToFirstSpeed : 2000, 32 singleItem : true, 33 autoHeight : true, 34 transitionStyle:"fadeUp" 35 }); 36 37 $(".owl-demo4>.owl-carousel").owlCarousel({ 38 autoPlay : 5000, 39 stopOnHover : true, 40 navigation: false, 41 paginationSpeed : 1000, 42 goToFirstSpeed : 2000, 43 singleItem : true, 44 autoHeight : true, 45 transitionStyle:"goDown" 46 }); 47 48 $(".owl-demo5>.owl-carousel").owlCarousel({ 49 autoPlay : 8000, 50 stopOnHover : true, 51 navigation: false, 52 paginationSpeed : 1000, 53 goToFirstSpeed : 2000, 54 singleItem : true, 55 autoHeight : true, 56 transitionStyle:"goDown" 57 }); 58 59 $(".owl-demo6>.owl-carousel").owlCarousel({ 60 autoPlay : 5000, 61 stopOnHover : true, 62 navigation: false, 63 paginationSpeed : 1000, 64 goToFirstSpeed : 2000, 65 singleItem : true, 66 autoHeight : true, 67 transitionStyle:"fadeUp" 68 }); 69 70 $(".owl-demo7>.owl-carousel").owlCarousel({ 71 items : 4, 72 lazyLoad : true, 73 navigation : true, 74 pagination:false, 75 }); 76 77 $(".owl-demo8>.owl-carousel").owlCarousel({ 78 autoPlay : 5000, 79 stopOnHover : true, 80 singleItem : true, 81 paginationSpeed : 1000, 82 goToFirstSpeed : 2000, 83 transitionStyle:"fade" 84 }); 85 86 $(".owl-demo10>.owl-carousel").owlCarousel({ 87 autoPlay : 8000, 88 stopOnHover : true, 89 navigation: false, 90 paginationSpeed : 1000, 91 goToFirstSpeed : 2000, 92 singleItem : true, 93 autoHeight : true, 94 transitionStyle:"backSlide" 95 }); 96 97 $(".owl-demo11>.owl-carousel").owlCarousel({ 98 autoPlay : 5000, 99 stopOnHover : true, 100 navigation: false, 101 paginationSpeed : 1000, 102 goToFirstSpeed : 2000, 103 singleItem : true, 104 autoHeight : true, 105 transitionStyle:"backSlide" 106 }); 107 108 $(".owl-demo12>.owl-carousel").owlCarousel({ 109 autoPlay : 5000, 110 stopOnHover : true, 111 navigation: false, 112 paginationSpeed : 1000, 113 goToFirstSpeed : 2000, 114 singleItem : true, 115 }); 116 117 $(".owl-demo13>.owl-carousel").owlCarousel({ 118 autoPlay : 18000, 119 stopOnHover : true, 120 navigation: false, 121 paginationSpeed : 1000, 122 goToFirstSpeed : 2000, 123 singleItem : true, 124 }); 125 126 $(".owl-demo14>.owl-carousel").owlCarousel({ 127 autoPlay : 5000, 128 stopOnHover : true, 129 navigation: false, 130 paginationSpeed : 1000, 131 goToFirstSpeed : 2000, 132 singleItem : true, 133 autoHeight : true, 134 transitionStyle:"goDown" 135 }); 136 137 $(".owl-demo15>.owl-carousel").owlCarousel({ 138 autoPlay : 9000, 139 stopOnHover : true, 140 lazyLoad : true, 141 pagination:true, 142 singleItem : true, 143 }); 144 145 $(".owl-demo16>.owl-carousel").owlCarousel({ 146 autoPlay : 12000, 147 stopOnHover : true, 148 lazyLoad : true, 149 pagination:true, 150 singleItem : true, 151 }); 152 153 $(".owl-demo17>.owl-carousel").owlCarousel({ 154 items : 2, 155 autoPlay : 9000, 156 stopOnHover : true, 157 lazyLoad : true, 158 pagination:true, 159 itemsDesktop : [1170,2], 160 itemsDesktopSmall : [1170,2] 161 }); 162 163 $(".owl-demo18>.owl-carousel").owlCarousel({ 164 autoPlay : 9000, 165 stopOnHover : true, 166 navigation: true, 167 paginationSpeed : 1000, 168 goToFirstSpeed : 2000, 169 singleItem : true, 170 autoHeight : true, 171 pagination:false, 172 transitionStyle:"backSlide" 173 }); 174 175 $(".owl-demo20>.owl-carousel").owlCarousel({ 176 autoPlay : 5000, 177 stopOnHover : true, 178 navigation: false, 179 paginationSpeed : 1000, 180 goToFirstSpeed : 2000, 181 singleItem : true, 182 autoHeight : true, 183 }); 184 185 $(".owl-demo20.owl-carousel").owlCarousel({ 186 autoPlay : 5000, 187 stopOnHover : true, 188 navigation: false, 189 paginationSpeed : 1000, 190 goToFirstSpeed : 2000, 191 singleItem : true, 192 autoHeight : true, 193 }); 194 195 var time = 7; // time in seconds 196 197 var $progressBar, 198 $bar, 199 $elem, 200 isPause, 201 tick, 202 percentTime; 203 204 //Init the carousel
205 $(".owl-demo9>.owl-carousel").owlCarousel({ 206 slideSpeed : 500, 207 paginationSpeed : 500, 208 singleItem : true, 209 afterInit : progressBar, 210 afterMove : moved, 211 startDragging : pauseOnDragging 212 }); 213 214 //Init progressBar where elem is $(".owl-demo") 215 function progressBar(elem){ 216 $elem = elem; 217 //build progress bar elements 218 buildProgressBar(); 219 //start counting 220 start(); 221 } 222 223 //create div#progressBar and div#bar then prepend to $(".owl-demo") 224 function buildProgressBar(){ 225 $progressBar = $("<div>",{ 226 id:"progressBar" 227 }); 228 $bar = $("<div>",{ 229 id:"bar" 230 }); 231 $progressBar.append($bar).prependTo($elem); 232 } 233 234 function start() { 235 //reset timer 236 percentTime = 0; 237 isPause = false; 238 //run interval every 0.01 second 239 tick = setInterval(interval, 10); 240 }; 241 242 function interval() { 243 if(isPause === false){ 244 percentTime += 1 / time; 245 $bar.css({ 246 width: percentTime+"%" 247 }); 248 //if percentTime is equal or greater than 100 249 if(percentTime >= 100){ 250 //slide to next item 251 $elem.trigger('owl.next') 252 } 253 } 254 } 255 256 //pause while dragging 257 function pauseOnDragging(){ 258 isPause = true; 259 } 260 261 //moved callback 262 function moved(){ 263 //clear interval 264 clearTimeout(tick); 265 //start again 266 start(); 267 } 268 269 270 271 var sync1 = $("#sync1 .owl-carousel"); 272 var sync2 = $("#sync2 .owl-carousel"); 273 274 sync1.owlCarousel({ 275 singleItem : true, 276 slideSpeed : 1000, 277 pagination:false, 278 afterAction : syncPosition, 279 responsiveRefreshRate : 200, 280 }); 281 282 sync2.owlCarousel({ 283 items : 5, 284 itemsDesktop : [1170,5], 285 itemsDesktopSmall : [979,5], 286 itemsTablet : [768,3], 287 itemsMobile : [479,3], 288 pagination:false, 289 responsiveRefreshRate : 100, 290 afterInit : function(el){ 291 el.find(".owl-item").addClass("synced"); 292 } 293 }); 294 295 function syncPosition(el){ 296 var current = this.currentItem; 297 $("#sync2") 298 .find(".owl-item") 299 .removeClass("synced") 300 .eq(current) 301 .addClass("synced") 302 if($("#sync2").data("owlCarousel") !== undefined){ 303 center(current) 304 } 305 306 } 307 308 $("#sync2").on("click", ".owl-item", function(e){ 309 e.preventDefault(); 310 var number = $(this).data("owlItem"); 311 sync1.trigger("owl.goTo",number); 312 }); 313 314 function center(number){ 315 var sync2visible = sync2.data("owlCarousel").owl.visibleItems; 316 317 var num = number; 318 var found = false; 319 for(var i in sync2visible){ 320 if(num === sync2visible[i]){ 321 var found = true; 322 } 323 } 324 325 if(found===false){ 326 if(num>sync2visible[sync2visible.length-1]){ 327 sync2.trigger("owl.goTo", num - sync2visible.length+2) 328 }else{ 329 if(num - 1 === -1){ 330 num = 0; 331 } 332 sync2.trigger("owl.goTo", num); 333 } 334 } else if(num === sync2visible[sync2visible.length-1]){ 335 sync2.trigger("owl.goTo", sync2visible[1]) 336 } else if(num === sync2visible[0]){ 337 sync2.trigger("owl.goTo", num-1) 338 } 339 } 340 341 342 var sync3 = $("#sync3"); 343 var sync4 = $("#sync4"); 344 345 sync3.owlCarousel({ 346 singleItem : true, 347 autoPlay : 5000, 348 slideSpeed : 1000, 349 stopOnHover : true, 350 pagination:false, 351 afterAction : syncPosition, 352 responsiveRefreshRate : 200, 353 }); 354 355 sync4.owlCarousel({ 356 itemsDesktop : [1170,5], 357 itemsDesktopSmall : [979,5], 358 itemsTablet : [768,3], 359 itemsMobile : [479,3], 360 pagination:false, 361 autoPlay : 5000, 362 stopOnHover : true, 363 responsiveRefreshRate : 100, 364 afterInit : function(el){ 365 el.find(".owl-item").addClass("synced"); 366 } 367 }); 368 369 function syncPosition(el){ 370 var current = this.currentItem; 371 $("#sync4") 372 .find(".owl-item") 373 .removeClass("synced") 374 .eq(current) 375 .addClass("synced") 376 if($("#sync4").data("owlCarousel") !== undefined){ 377 center(current) 378 } 379 380 } 381 382 $("#sync4").on("click", ".owl-item", function(e){ 383 e.preventDefault(); 384 var number = $(this).data("owlItem"); 385 sync3.trigger("owl.goTo",number); 386 }); 387 388 function center(number){ 389 390 var sync4visible = sync4.data("owlCarousel").owl.visibleItems; 391 392 var num = number; 393 var found = false; 394 for(var i in sync4visible){ 395 if(num === sync4visible[i]){ 396 var found = true; 397 } 398 } 399 400 if(found===false){ 401 if(num>sync4visible[sync4visible.length-1]){ 402 sync4.trigger("owl.goTo", num - sync4visible.length+2) 403 }else{ 404 if(num - 1 === -1){ 405 num = 0; 406 } 407 sync4.trigger("owl.goTo", num); 408 } 409 } else if(num === sync4visible[sync4visible.length-1]){ 410 sync4.trigger("owl.goTo", sync4visible[1]) 411 } else if(num === sync4visible[0]){ 412 sync4.trigger("owl.goTo", num-1) 413 } 414 } 415 416 417 $("#colosebut1").on( 'click', function(){ 418 $("#div1").fadeOut("slow"); 419 }); 420 $("#colosebut2").on( 'click', function(){ 421 $("#div2").fadeOut("slow"); 422 }); 423 $("#colosebut3").on( 'click', function(){ 424 $("#div3").fadeOut("slow"); 425 }); 426 $("#colosebut4").on( 'click', function(){ 427 $("#div4").fadeOut("slow"); 428 }); 429 430}); 431 432})(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.