-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Marquee Speed Suggestion/Feature #1
Comments
I suggest that rename "speed" to "duration" which means how long it takes to move a pixel from start point to end point |
I've done some maths and if you divide the content width by the parent width and use the result as a modifier for the speed/duration (o.speed*speedAdjustment) you will get a result for the amount of time it takes for the visible content to scroll from left to right. I.E If the parent container is 300px and the speed/duration is set to 10s/10,000ms it will take 10s for 300px of content to pass through the visible window. Example code (Add in after line 33 where elWidth is set): Hopefully this makes sense. If I get time this week I'll work out a more suitable implementation and put in a pull request. |
That would be great. Thats totally makes sense. |
Any better? 6535215 |
I'm trying to set up a marquee that has the same animation speed regardless of content size or text length (I'll consider the currently available speed option as the duration, as it should be renamed imho). After 6535215 , the animation duration is always adjusted according to the elWidth|elHeight, supposedly. However, as I went ahead and implemented an adjustSpeed boolean option to opt out of the adjustment, I realized that adjustmet was already being done before the formula used now (see https://github.com/aamirafridi/jQuery.Marquee/blob/master/jquery.marquee.js#L83). What makes it adjust duration without it is that the increment used is the elWidth/elHeight in the case Does somebody know how I can achieve a constant animation speed regardless of content size? |
Not sure what exactly you are asking but currently the speed you defined will remain constant regardless of the content size. Check this http://jsfiddle.net/aamir/jc7F3/48/ |
Well, I'm surprised now because I've tested a lot of combinations and went through the whole code, never to see that behaviour. |
Hi everyone, Can anyone help me to achieve this.??? |
opening new issue |
Try duration: http://jsfiddle.net/aamir/nmo8xkw4/
…On Fri, Dec 14, 2018 at 8:59 AM Giorgos Kontopoulos < ***@***.***> wrote:
when using duplicated: true the speed is not same anymore
duplicated the test case above and added extra option
http://jsfiddle.net/GiorgosK/1ohk07vw/
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADaWIcjhK6lrhF59qRtXCkvBEEFzv2vks5u42hhgaJpZM4AZ3wF>
.
|
@aamirafridi it seems the speed is still not the same |
Feature request:
Currently the speed is based on the milliseconds which is great if you are working with a static width (It takes 10,000ms to move 800px). However as the content area expands the speed of the marquee increases to potentially un-manageable/un-readable speed.
Suggestion:
Calculate the speed based on distance/time. It would probably be worth having an option to add a parent container that would be taken into account in the speed calculation.
`
This approach would mean that the scroll speed would be consistent whether the scrolling content is 500px or 5000px.
The text was updated successfully, but these errors were encountered: