D
D
dk-web2015-11-09 12:09:33
css
dk-web, 2015-11-09 12:09:33

What is the best way to calculate math?

Given:
block - length is not limited. Content (pictures) are stretched in a line by float. Absolutely positioned, left=0.
arbitrary number from 0 to 360 - obtained by rotating the image around its axis (center).

You need to make an offset relative to this image of all content.

The image moves, everything is ok. but only within the limits, respectively, from 0 to 360.
And I need it to go beyond the limits. that is, left became negative, including ..

I looked at how it is implemented in the sliders, but the devil will break his leg - everything is different everywhere.
I'm sure there is a simple solution.

What did you think. Take the full width of the content
$(content).width - let's say - 2000px;
Start a flag and wind it up to 2000 or - 2000 ...

Essentially, we need something like this...
baijs.com/tinycircleslider
The first example.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sergey, 2015-11-09
@hahenty

There is some kind of zero point from which you can calculate the position of the pictures in the feed, the position is a relative offset from zero. The zero point changes with a twist, the offset of a specific picture is added to it, we calculate the remainder from dividing the resulting amount by the length of the tape, we get the position of the picture.
kk[i] = ( nn + okk[i] ) % l
kk[i] - calculated image position;
okk[i] - relative image offset;
nn - current zero position, can be negative;
l - the length of the tape, the sum of the sizes of the pictures.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question