How to use Dreamweaver to make drag and drop effect

Source: Internet
Author: User
Tags dreamweaver

On the Internet, we can often see some very practical drag-and-drop effects, especially when applied to online shopping, visitors can directly drag the selected items to the shopping box or shopping cart, very convenient and interesting. But most people do not know, in fact, the behaviors in Dreamweaver can make the same effect. If you are interested, join me in making a shopping box with drag and drop effects.

Before doing the drag-and-drop page, first we have to prepare some pictures. For example, a large picture of a shopping box or shopping cart, plus a few small pictures representing items. I have a shopping bag here, and a few things, they are: mobile phones, game handles and cars (WOW! Cars can also be dragged into shopping bags!).

With the pictures ready, we can start our work. Open Dreamweaver, create a new page, select the Layer tool in the object panel, and then drag a layer over the page with the mouse (or select "Insert/layer" to insert a new layer). Then, put the mouse in the layer, then select object/Insert Image tool, and insert a picture that you just prepared in this layer.

Repeat the above action, then insert 3 layers, then insert each of the other pictures you have prepared in the 3 layers. The effect is shown in Figure 1 after completion.

Figure 1

Okay, here's the big step. Clicking "Window/action" will pop up the "Action (Behaviors)" dialog box, as shown in Figure 2. Click on the "+" above the dialog box, there will be a pop-up menu, select the "Drag Layer" in this menu, and then pop-up, is the "Drag Layer" dialog box, as shown in Figure 3.

Figure 2

In this dialog box, you can set properties for several layers, respectively. We set the layer that was inserted into the shopping bag image as "unconstrained layer", and the remaining layers are set to removable layer (constrained). There is also a "Advanced" option on this dialog, click it, check the "when Drag" option on this panel, and then set the "ring layer to front,then" option to "restored Z-index".

Figure 3

Repeat the above steps, set the properties of several other layers, set up a good "behaviors" dialog box in the Middle text box has 4 more "onLoad" tag.

OK, set this up, our work is done, do not forget to save the page, and then press the "F12" button to see you do drag the page cool?

  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.