Skip to content

Commit

Permalink
Merge pull request #338 from wpexplorer/master
Browse files Browse the repository at this point in the history
Adds settings to customize the next/previous arrows and fixes issue with slider width not using Math.round()
  • Loading branch information
davidghi authored Feb 24, 2024
2 parents d1224b7 + 4ef4067 commit cfd5aeb
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions dist/js/jquery.sliderPro.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,11 @@

// Initially set the slide width to the size of the slider.
// Later, this will be set to less if there are multiple visible slides.
this.slideWidth = this.$slider.width();
if ( this.settings.fade === true ) {
this.slideWidth = this.$slider.width();
} else {
this.slideWidth = Math.round( this.$slider.width() );
}

// Set the height to the same size as the browser window if the slider is set to be 'fullWindow',
// or calculate the height based on the width and the aspect ratio.
Expand Down Expand Up @@ -1068,6 +1072,12 @@
// Breakpoints for allowing the slider's options to be changed
// based on the size of the window.
breakpoints: null,

// Previous arrow html.
previousArrow: '<div class="sp-arrow sp-previous-arrow"></div>',

// Next arrow html.
nextArrow: '<div class="sp-arrow sp-next-arrow"></div>',

// Called when the slider is initialized
init: function() {},
Expand Down Expand Up @@ -4759,8 +4769,8 @@
if ( this.settings.arrows === true && this.$arrows === null ) {
this.$arrows = $( '<div class="sp-arrows"></div>' ).appendTo( this.$slidesContainer );

this.$previousArrow = $( '<div class="sp-arrow sp-previous-arrow"></div>' ).appendTo( this.$arrows );
this.$nextArrow = $( '<div class="sp-arrow sp-next-arrow"></div>' ).appendTo( this.$arrows );
this.$previousArrow = $( this.settings.previousArrow ).appendTo( this.$arrows );
this.$nextArrow = $( this.settings.nextArrow ).appendTo( this.$arrows );

this.$previousArrow.on( 'click.' + NS, function() {
that.previousSlide();
Expand Down Expand Up @@ -6287,4 +6297,4 @@ JWPlayerVideo.prototype.replay = function() {
this.player.play( true );
};

})( jQuery );
})( jQuery );

0 comments on commit cfd5aeb

Please sign in to comment.