• Hey all, due to some issues with false DMCA takedown requests, we've had to remove and censor a few things until the situation is resolved. Sorry for any inconvenience.
  • Be sure to join the discussion on our discord at: Discord.gg/serebii
  • If you're still waiting for the e-mail, be sure to check your junk/spam e-mail folders

Code help.

Nator

«My Bishounen«
Can anyone tell me how to make a movable images? Like when you click-hold on the image, and drag it, it moves to the area your dragging it. Such as moving windows on your computer.
 
The only way I could think to do it is in C/J++, it could probably done in HTML, but I'm not skilled enough in that. Normally it depends on the browser. I thing Opera/Mac Browser automaticcaly has that enabled. I really don't know how you'd do it
 
Javascript. It can do whatever you can imagine.

I don't know how experienced you are with JavaScript, but to move elements around a web page based on user input isn't very easy. That's why I found for you this JS library, all you have to do is download the file and upload it to your website.

When you want to be able to move images, write this into the <head> section:
Code:
<script type="text/javascript" src="wz_dragdrop.js"></script>

And then if you want to be able to move a specific image, change it's <img> tag to also contain a name="" attribute, and assign a name (whatever you want, without spaces), like this:

Code:
<img src="my_image.png" alt="My Image" name="my_name" />

Repeat that for all images. You can also allow the moving of other elements, like buttons, textboxes, etc. Anything you can see really.

The last step is to "register" all movable elements. At the very bottom of your page, before you close the <body> tag, write this code:

Code:
<script type="text/javascript">
<!--
SET_DHTML("name1", "name2", "name3", "name4");
//-->
</script>

And change "name1" to the name of a movable image. You don't have to have four moving items, you can delete the rest and just call it like this, for one movable item: SET_DHTML("name1");

Likewise, you can have more than four moving items. The number of moving stuff is unlimited.

Have fun!

And you'll want to actually download the file, right?

You can download it (wz_dragdrop.zip) near the bottom of this page.

If you need any other help with this, just ask.
 
I know a way.
I have a host, so on the top just add this:
Code:
<script type="text/javascript" src="http://bulletro.com/dragndrop.js">
</script>
And add this before closing the body tag:
Code:
<script type="text/javascript">
<!--

SET_DHTML("name1", "name2", "anotherLayer", "lastImage");

//-->
</script>
Uploaded for the people who wants it.
 
Last edited:
Back
Top