Giter Site home page Giter Site logo

grouploop's People

Contributors

scottalguire avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

alpzaf

grouploop's Issues

If the area size is different from the window size, it will not work properly.

This is a problem I found during multiple tests.
image

Analyzing the source, it is operating based on the entire window size.
In my opinion, it should move based on 'childWrapper'.

So, I modified it as below and tested it.

	window.addEventListener("resize", function ()
	{
		windowWidth = $(el).find(settings.childWrapper)[0].scrollWidth / 2 - 1;
		wrapperWidth = $(el).width();

		if (settings.stickFirstItem)
		{
			stickFirstItemFunc();
		}
	});

Now it works as desired.

Transition length is limited to screen width, even when the wrapper is a lot larger

Hi!

I noticed an issue with the looping part of the animation process. At the moment the translation is done depending on the window width. When the group is larger than that, the looping animation jumps earlier to the first position, making the effect look choppy.

The best I can see (and I am not a JS expert), you are using the main container width for wrapperWidth at

var wrapperWidth = $(window).width() < 768 ? $(el).width() * 2 : $(el).width();
instead of using the width of the childWrapper element. Thus your examples always transition for a distance equal to the window width.

One more thing to consider: the loop element might be inside a container narrower than the window width. Perhaps you might want to look at using the parent container width and the childWrapper width when calculating the translation values?

Here is an example where I am using the latest version (1.0.3) and the jumping effect is very visible:

http://lpv2ab-dev-4824874-4824874.hs-sites.com/-temporary-slug-628fe64a-bffb-407f-989a-5df97c6548db?hs_preview=xUnyBBom-6137431923

Looking forward to hearing back from you.

Regards,

Adrian

Option `forward: false` doesn't work out of the box

Hi! I am using your script to animate a series of Bootstrap cards and I noticed that the forward: false option causes an error at line 112:

.split(/[()]/)[1]

The script is looking for the transform property which doesn't exist by default.

My workaround has been to add a dummy translation to the child wrapper element:

<div class="slider-rail" style="transform: translateX(0)">...</div>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.