mmsh350
IT Specialist : Am A Successful IT Professional With Expertise In Full Stack Web Development.
Wants to meet Career Partners : Goal Achievers
Articles
189
Followers
44
profile/5736download.png
Mmsh350

The 5 Best Non-Contact Thermometers To Help You Stay Germ-Free
~0.5 mins read
While we may be going back to school, work, and a touch of normalcy, the threat of COVID is far from over. Testing may not be readily available to everyone everywhere, so one of the best ways to measure your health is through a thermometer. Since we want to prevent as much cross contamination as possible, we have chosen some of the best non-contact thermometers to keep you safe, healthy, and germ-free. read more : https://www.msn.com/en-us/news/technology/the-5-best-non-contact-thermometers-to-help-you-stay-germ-free/ar-BB18ku6C
profile/5736download.png
Mmsh350

Simple Drag & Drop Image Using JavaScript
~9.4 mins read
In this code we will try to do Simple Drag & Drop Image using JavaScript. The program will enable you to drag and drop an image to different position. The trick of this code is to bind each div element with an id then receive with a binded image in ondragstart event. To learn more about this, just follow the steps below.
Getting started:
First you have to download bootstrap framework, this is the link for the bootstrap that I used for the layout design https://getbootstrap.com/.
The Main Interface
This code contains the interface of the application. To create this just write these block of code inside the text editor and save this as index.html.
Creating the Script
This code contains the script of the application. The code will allow you to do a drag and drop event to an image element. To do this just copy and write these block of codes inside the text editor, then save it as script.js inside the js folder.
function drop(e){
e.preventDefault();
var image = e.dataTransfer.getData("image");
e.target.appendChild(document.getElementById(image));
document.getElementById(image).style="width:100%;";
}
function dragOver(e){
e.preventDefault();
}
function drag(e){
e.dataTransfer.setData("image", e.target.id);
}
There you have it we successfully created a Simple Drag & Drop Image using JavaScript. I hope that this simple tutorial help you to what you are looking for. For more updates and tutorials just kindly visit this site. Enjoy Coding!
Advertisement

Link socials
Matches
Loading...