Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,855 members, 7,802,741 topics. Date: Friday, 19 April 2024 at 08:32 PM

I Am Learning Javascript, I Need Help With The Code I'm Writing - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / I Am Learning Javascript, I Need Help With The Code I'm Writing (614 Views)

I Find It Hard Learning Javascript...i Need Help / How To Go About Learning Javascript Within Two Weeks / Difficulties Learning Javascript? This Will Change Your Life! (2) (3) (4)

(1) (Reply) (Go Down)

I Am Learning Javascript, I Need Help With The Code I'm Writing by ugom123: 8:24am On Mar 14, 2021
Any help here please, will really appreciate. Been on this for more than 15 hours

I have written and animated two images and text tags using Css keyframe animation.

So, I want to be able to control these same animations using Javascript via two buttons I already created. I have researched and researched, can't solve this logic.

The animation I did via css keyframe happened this way:

When you load the page, the first image slide in from left, stayed for few seconds and slide out via left and the second image slide in and remained on the page. The texts tags animated for each of the images.

Now, I want to be able to use the buttons to slide the images in and out after the css animations have completed. Help me, pls if you can. Thanks
Re: I Am Learning Javascript, I Need Help With The Code I'm Writing by stanliwise(m): 8:31am On Mar 14, 2021
ugom123:
Any help here please, will really appreciate. Been on this for more than 15 hours

I have written and animated two images and text tags using Css keyframe animation.

So, I want to be able to control these same animations using Javascript via two buttons I already created. I have researched and researched, can't solve this logic.

The animation I did via css keyframe happened this way:

When you load the page, the first image slide in from left, stayed for few seconds and slide out via left and the second image slide in and remained on the page. The texts tags animated for each of the images.

Now, I want to be able to use the buttons to slide the images in and out after the css animations have completed. Help me, pls if you can. Thanks

You’re talking of event. Attach an event listener to the button.

Create a function to do what you want,
Create an event listener

So your codes go like this

function doTheAmination(){
}


myButton.onclick => should call doTheAnimation

2 Likes

Re: I Am Learning Javascript, I Need Help With The Code I'm Writing by ugom123: 8:51am On Mar 14, 2021
stanliwise:


You’re talking of event. Attach an event listener to the button.

Create a function to do what you want,
Create an event listener

So your codes go like this

function doTheAmination(){
}


myButton.onclick => should call doTheAnimation

Thank you brotherly.so grateful that someone showed interest to help me. Pls, can I add you on WhatsApp?
Re: I Am Learning Javascript, I Need Help With The Code I'm Writing by Karleb(m): 9:06am On Mar 14, 2021
Re: I Am Learning Javascript, I Need Help With The Code I'm Writing by stanliwise(m): 9:07am On Mar 14, 2021
ugom123:


Thank you brotherly.so grateful that someone showed interest to help me. Pls, can I add you on WhatsApp?
0 eight 1 72 eight 3 three zero 7 3
Re: I Am Learning Javascript, I Need Help With The Code I'm Writing by ugom123: 9:13am On Mar 14, 2021
stanliwise:
0 eight 1 72 eight 3 three zero 7 3

Thank you so much bro.
Re: I Am Learning Javascript, I Need Help With The Code I'm Writing by ahmedsaniadamu(m): 11:21pm On Mar 14, 2021
it's some times very hard to control CSS animation using JavaScript I prefer coding the animation itself using JavaScript timing event called setInterval (); with this event you can easily set control and manipulate HTML elements
Re: I Am Learning Javascript, I Need Help With The Code I'm Writing by ugom123: 8:41am On Mar 19, 2021
ahmedsaniadamu:
it's some times very hard to control CSS animation using JavaScript I prefer coding the animation itself using JavaScript timing event called setInterval (); with this event you can easily set control and manipulate HTML elements

You have a point. I have noticed that it is hard to really control CSS animations especially, the keyframe ones. I have given up and will try and animate using javascript and set transition in css.
Re: I Am Learning Javascript, I Need Help With The Code I'm Writing by Qsand: 4:56am On Mar 20, 2021
stanliwise:

You’re talking of event. Attach an event listener to the button.
Create a function to do what you want, Create an event listener
So your codes go like this
function doTheAmination(){ }

myButton.onclick => should call doTheAnimation
Does anyone still use on click... Shouldn't it be
myButton.addeventlistener ('click', doTheAnimation)
Re: I Am Learning Javascript, I Need Help With The Code I'm Writing by stanliwise(m): 10:40am On Mar 20, 2021
Qsand:


Does anyone still use on click... Shouldn't it be

myButton.addeventlistener ('click', doTheAnimation)
Everything is a semantic perhaps I was writing a pseudo code
Re: I Am Learning Javascript, I Need Help With The Code I'm Writing by bularuz(m): 11:05am On Mar 20, 2021
Is there anyone that can teach angular or vue

(1) (Reply)

How To Make My Website Have The Same View On Both Mobile And Desktop / Learn How To Build And Sell Your Own Apis $$$ / How To Protect A Disc

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.