Carousel

.overflow-hidden { overflow: hidden } .carousel .photo-new { left: 0 } .carousel .photo-a { background: #ececec; -webkit-transition: all 150ms ease; -moz-transition: all 150ms ease; -ms-transition: all 150ms ease; -o-transition: all 150ms ease; transition: all 150ms ease; } .carousel .photo-a:hover { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* IE 8 */ filter: alpha(opacity=80); /* IE7 */ opacity: 0.8; text-decoration: none; } .autodealers-carousel-caption { height: 20px; margin-bottom: 20px } .carousel nav { background: none } #autodealers-carousel-mobile .carousel-inner {width:auto;} .right { float: right } .photo-a { border-radius: 6px; display: block; margin-bottom: 10px; overflow: hidden; position: relative; } .photo-img { opacity: 1; transition: opacity 400ms ease-in-out 0s; width: 100%; } .photo-new { left: 14px; position: absolute; top: 0; max-width: 50% } // Switch image source var _image_switch = function (){ jQuery("[data-image-switch='autodealers']").each(function(){ var _this = jQuery(this); var _continue = false; var _hasSrc = false; var _src = ""; var _newSrc; var _preload = false; var _replaceFrom; var _replaceTo; var _imageWidth; // Get src if (_this.attr("src").indexOf("/320/") > -1 || _this.attr("src").indexOf("/640/") > -1) { _src = _this.attr("src"); _hasSrc = true; if (_this.is(":visible")) { _preload = true; } } else if (null != _this.attr("data-lazyloader-src")) { _src = _this.attr("data-lazyloader-src"); } // Get src size if (_src.indexOf("/320/") > -1) { _imageWidth = 320; } else { _imageWidth = 640; } if (_this.width() > 320 && _imageWidth == 320) { // Load larger 640 image _replaceFrom = /\/320\//g; _replaceTo = "/640/"; _continue = true; } else if (_this.width() < 320 && _imageWidth == 640) { // Load smaller 320 image _replaceFrom = /\/640\//g; _replaceTo = "/320/"; _continue = true; } if (_continue) { // Replace all except visible image if (null != _this.attr("data-lazyloader-src")) { _this.attr("data-lazyloader-src", _this.attr("data-lazyloader-src").replace(_replaceFrom, _replaceTo)); } if (null != _this.attr("data-timeslider-image")) { _this.attr("data-timeslider-image", _this.attr("data-timeslider-image").replace(_replaceFrom, _replaceTo)); } if (_hasSrc) { _newSrc = _src.replace(_replaceFrom, _replaceTo); // Preload visible image if (_preload) { // Preload image var preloadedImage = _this .clone() .attr("src", _newSrc) .css({ display: "none" }); _this.after(preloadedImage); // Replace src preloadedImage.on("load", function(){ preloadedImage.remove(); _this.attr("src", _newSrc); }); } else { // Change source of non visible image _this.attr("src", _newSrc); } } } }); } jQuery(_image_switch); jQuery(window).on("resize", function(){ jQuery(window).data("image-switch-last-calculated-width", jQuery(window).width()); var t = setTimeout(function(){ if ( jQuery(window).width() == jQuery(window).data("image-switch-last-calculated-width") && jQuery(window).width() != jQuery(window).data("image-switch-last-executed-width")) { jQuery(window).data("image-switch-last-executed-width", jQuery(window).width()); _image_switch(); } }, 500); }); // Lazyloading & timeslider var _lazyload = function() { jQuery("[data-lazyloader]").Lazyloader({ events: { afterShow: function(){ this.TimeSlider({ events: { afterNextImage: function(){ _image_switch(); } } }); } } }); } jQuery(_lazyload); // Reposition images var _fix_slide_dimensions = function(){ jQuery(".photo-group:visible").each(function(){ var _Items = jQuery(this).find(".photo-a.auto-caroussel"); var _imageFirst = _Items.find(".photo-img:visible:first"); var _imageWidth = _Items.find(".photo-img:visible:first").width(); var _borderTop = parseInt(_imageFirst.css('borderTop')) || 0; var _borderBottom = parseInt(_imageFirst.css('borderBottom')) || 0; _Items.css({ height: (_imageWidth * 0.75) + _borderTop + _borderBottom + "px" // 4:3 }); }); } jQuery(window).on("load", _fix_slide_dimensions); jQuery(window).on("resize", _fix_slide_dimensions); jQuery(function(){ var _Caroucel = jQuery("#autodealers-carousel"); // Construct mobile carousel var _Clone = _Caroucel.clone(); var _CloneId = _Clone.attr("id") + "-mobile"; var _Items = _Clone.find(".autodealers-carousel-item"); _Items.addClass("item"); jQuery(_Items[0]).addClass("active"); _Clone.children(".carousel-inner").html(_Items).addClass('row'); _Clone.removeClass("hidden-xs"); _Clone.addClass("visible-xs"); _Clone.attr("id", _CloneId); _Clone.find("[data-target]").attr("data-target", "#" + _CloneId) _Clone.insertAfter(_Caroucel); _Caroucel.carousel({ interval: 3000 }); _Clone.carousel({ interval: 3000 }); });

Beoordelingen

Geen titel

Rated 5 out of 5
31/01/2021

Top auto gekocht, bedankt voor alle goede service

Wouter Ommen

Selecteer een waardering5 sterren4 sterren3 sterren2 sterren1 Ster

PreviousNext

Welkom

Wij zijn PBeek occasions, specialist in in- en verkoop van gebruikte occasions. Bij ons treft u allerlei verschillende merken aan die wij graag aan u laten zien.

× Contact