Lowest price ever! Learn Generative AI for 48% less!
Get my discount
+ 15

I have this code. I added mouse events for the left and right buttons but I also need to add touch events. I am stuck at that.

I am stuck at the touch events. I tried a few ways and every time something was wrong because the movement of the circle was either accelerating, meaning that the clearInterval did not work properly or the whole circle stood in the same position, without any rotation. Help me please, I am stuck. I am thinking that in the worst case scenario, this will be a code only for users with mouse. Extra info: when not pressing the buttons, the circle should rotate slowly, and then stop when we press any of the 2 buttons. Pressing any of the 2 buttons will cause a quicker rotation speed and releasing them will stop the quick rotation and set the interval again with the slow rotation. I completely deleted my attempts on touch events, so that I or anyone can start with those from 0. The codepen link to the code. The obe i posted may not work properly https://codepen.io/AlexTAG/pen/qBRpQoL //Ik it the code is full of intervals and it looks like hell.

13th Apr 2021, 9:44 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
12 Answers
+ 17
Here is a solution for that does it fullfil your need 🍇 Alex Tușinean 💜 https://code.sololearn.com/Wym7316GL4sG/?ref=app
13th Apr 2021, 10:15 AM
Arnav Kumar [Less/Not Active]
Arnav Kumar [Less/Not Active] - avatar
+ 6
Woah, it looks so simple. To think it was just a matter of true or false, amazing! Thanks a lot.
13th Apr 2021, 11:07 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 3
Arnav Kumar [📕Schools📚] Thanks for your help to a college student. You deserve a compliment as others do who are helping. This is the thru spirit of SoloLearn. I'm very happy and excited to see that the next generation is doing what we old geezers did at a time that no one knew very much and experimenting was the only solution. Even a time with so much and fast changes that you couldn't keep up. What you learned today was obsolete the next week. Anyway I wish you all a lot of success and fun because coding is fun too in my point of view. I'm retired but keep myself busy with coding so keep up with the spirit my friends 😉
15th Apr 2021, 4:37 AM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
13th Apr 2021, 11:12 AM
Arnav Kumar [Less/Not Active]
Arnav Kumar [Less/Not Active] - avatar
+ 2
🇺🇸 Anatoli🇧🇪🇪🇺 Thanks 🥰 Even in today's date there are many topics in coding what are not talked about much and have very less resources and when you search you don't find a relevant explanation and we have to do it by experimenting by ourselves As Humans we are always curious to learn and help others as we are in community So experimeng will never get old 😉 And I will try best in my life to learn and become a successful with just a thought in my mind "Success doesn't matters what matters is your journey to achieve the success" so i enjoy the journey 😃
15th Apr 2021, 4:46 AM
Arnav Kumar [Less/Not Active]
Arnav Kumar [Less/Not Active] - avatar
0
This is so complicated that it makes my head spin Did you make it in Dreamweaver? Maybe a Notepad++? I admire you so much
24th Apr 2021, 9:47 AM
sweetswing2460
0
I hope you got the answer ,if you are still looking for answer, lets us know we will discuss with below link <br> <a href="https://www.gologica.com/course/javascript/" rel="nofollow">JavaScript</a> <br>
26th May 2023, 7:56 AM
v1nayak gologica
v1nayak gologica - avatar
0
When booking economy flights online, travelers can opt to receive real-time flight updates via email or mobile notifications. These updates may include information about flight delays, gate changes, or cancellations. Having access to timely information helps travelers stay informed and make necessary adjustments to their travel plans as needed here https://economy.flights/flights/.
8th Nov 2023, 5:28 AM
Eric Roer
Eric Roer - avatar
0
Even in this day and age, there are still a lot of coding-related subjects that are rarely discussed, have few resources, and require independent experimentation because there aren't many appropriate explanations online. https://www.prodigitizing.co.uk/puff-digitizing
20th Dec 2023, 10:29 AM
Noah Isla
Noah Isla - avatar
0
I appreciate your kind words and encouragement to a fellow college student. It's heartening to witness the spirit of collaboration and learning, reminiscent of the experimentation and challenges faced during our own times. The enthusiasm of the next generation in navigating a rapidly evolving field, where knowledge becomes obsolete quickly, is truly commendable. Wishing you all continued success and enjoyment in coding – a pursuit I find fulfilling even in my retirement. Keep up the spirit of exploration and learning, my friends! <a href="https://lampinstitute.in/flutter-training-in-hyderabad/">Flutter Training in Hyderabad</a>
9th Feb 2024, 11:31 AM
anwar anwar
anwar anwar - avatar
0
I am stuck at the touch events. I tried a few ways and every time something was wrong because the movement of the circle was either accelerating, meaning that the clear Interval did not work properly or the whole circle stood in the same position, without any rotation. Help me please, I am stuck. //Ik it the code is full of intervals and it looks like hell.https://lampinstitute.in/snowflake-training-in-hyderabad/
16th Feb 2024, 1:26 PM
Ganesh Brolly
Ganesh Brolly - avatar
- 4
Привет
13th Apr 2021, 7:47 PM
bringo
bringo - avatar