PHP Classes

File: plugins/carouseller/js/carouseller.min.js

Recommend this page to a friend!
  Classes of Laudir Bispo   PHP Real Estate Website   plugins/carouseller/js/carouseller.min.js   Download  
File: plugins/carouseller/js/carouseller.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Real Estate Website
Manage the properties of a real estate business
Author: By
Last change:
Date: 3 years ago
Size: 1,583 bytes
 

Contents

Class file image Download
var carousel=function(t,i){"undefined"==typeof i&&(i=0),this.obj=$(t),this.autoscrolldelay=i,$(this.obj).find(".carousel-button-left").on("click",this.left.bind(this)),$(this.obj).find(".carousel-button-right").on("click",this.right.bind(this)),$(this.obj).on("mouseenter",this.mousein.bind(this)),$(this.obj).on("mouseleave",this.mouseout.bind(this)),i&&(this.interval=window.setInterval(this.right.bind(this),i))};carousel.prototype={obj:null,interval:null,scrollSpeed:200,stop:!1,mousein:function(){window.clearTimeout(this.interval)},mouseout:function(){this.autoscrolldelay&&(this.interval=window.setInterval(this.right.bind(this),this.autoscrolldelay))},left:function(){if(!this.stop){this.stop=!0;var t=$(this.obj).find(".carousel-block").outerWidth();$(this.obj).find(".carousel-items .carousel-block").eq(-1).prependTo($(this.obj).find(".carousel-items")),$(this.obj).find(".carousel-items").css({left:"-"+t+"px"}),$(this.obj).find(".carousel-items").animate({left:"0px"},this.scrollSpeed,function(){this.stop=!1}.bind(this))}},right:function(){if(!this.stop){this.stop=!0;var t=$(this.obj).find(".carousel-block").outerWidth();$(this.obj).find(".carousel-items").animate({left:"-"+t+"px"},this.scrollSpeed,function(){$(this.obj).find(".carousel-items .carousel-block").eq(0).css("margin-left","0.25641%"),$(this.obj).find(".carousel-items .carousel-block").eq(0).appendTo($(this.obj).find(".carousel-items")),$(this.obj).find(".carousel-items .carousel-block").eq(0).css("margin-left","0"),$(this.obj).find(".carousel-items").css({left:"0px"}),this.stop=!1}.bind(this))}}};