Skip to content

How to display the first carousel element in the left of content area #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cguedes opened this issue Apr 3, 2018 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@cguedes
Copy link

cguedes commented Apr 3, 2018

The default settings displays the first element in the center of the content area

One can see this behavior in the sample you provide here
image

I was expecting a setting to have the first item (1) in the left of content area, like the following:

image

This might also be related with the feature for having a setting to control the "infinite" scroll.

Thanks for having this project.

@Carr1005 Carr1005 assigned Carr1005 and unassigned Carr1005 Apr 3, 2018
@Carr1005 Carr1005 added the enhancement New feature or request label Apr 3, 2018
@Carr1005
Copy link
Owner

Carr1005 commented Apr 3, 2018

@cguedes, thanks for your attention ! It's a pity that this feature is not provided yet. I believe it could be achieved by adjusting the calculation properly in functions below. But it still needs time for well test and some considerations about how is a good way to add it.

Sorry if you have an urge, the structure of this component is really not too complicated and all JS code is just in /src/index.js now, maybe you could just copy it with css file, and try something like below, it seems no problem in my attempt:

Edit issue2


initialSlideCon() {
    if (this.mannerSetting.circular && this.slideCnt !== 1) {

<<<<<<<

        this.slidingManner.initialMovement = this.slidingManner.slidesTotalWidth  - (this.refs.sliderBox.offsetWidth - (this.imgsWidth[1] + this.itemsMargin * 2)) / 2;
   
=======

       this.slidingManner.initialMovement = this.slidingManner.slidesTotalWidth;
   
>>>>>>>

    }

}

and

calMovement(direction){

<<<<<<<
    
    let movement = this.imgsWidth[this.state.currentSlide] / 2 + (this.itemsMargin * 2) + this.imgsWidth[this.state.currentSlide + count] / 2;

=======

    let movement = this.imgsWidth[this.state.currentSlide] + (this.itemsMargin * 2);
      
>>>>>>>

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants