Skip to content
Advertisement

Tag: image

How to switch images using JS?

I have a simple code that switches text when an image is clicked: js: HTML: Is it possible to switch images when language is switched (for example, when English language is set, GB flag disappears)? Answer Edit html like that add class hidden element

image is not show in img tag when upload it again

I use the following method to upload an image and display it in an img tag. Another button is used to delete that image. Upload and delete are working well, but the problem is when I want to upload an image again after it has been deleted. It does not be show up and when I open the console it

Move an image after (x) seconds

Im trying to make an image move to a random spot on the webpage after 5 seconds so far I have this: How do I get it to move after 5 seconds? Answer create an moveImage function: Update the onClick to use the new function: Update the interval to use the new function: The whole thing:

How do I show png images based on their names in javascript?

I have a folder with png images and several other types of files. I only want to display the png images in the order of their names, how can I do that? All images end in a number; for example, each image is titled “image_001”, “image_002”, and so on. Right now I have all the images grouped together in a

Require non-static image in React Native

I have a special folder with images in my React Native application. Path to these pictures is stored in the special object that is passed as prop to the Card component. So, I can’t use require, because it uses only static path string. How can I use load these images from my props? There is my try: Answer As your

Advertisement