The production of sliding menu (PHOTOS)

Source: Internet
Author: User
Tags add insert
The menu today should be requested by friends, to write a simple tutorial on the effect of a sliding menu on my site; at the University of tendon, the software department has a layer sliding effect, as if the ads on the Itnow is also used in this effect, when not to hide, use the time to click the button layer slowly slide out, That is to save a limited page space, but also to achieve an enviable visual effect, it feels good. This effect you can click here to see.

Shut up and talk less. The preparatory work is as follows:

1. Create a new blank document in the DW (or open the page you want to add an effect to).

2. Set your own CSS style.

3. Insert a long 500pix table on the page (note: The purpose of the Insert table is to control the level of the relative position at different resolutions, if your page does not have the relevant settings, then this one you may have to work hard to organize your page structure).

4. Place the cursor in the table, click on the menu [insert-layer] to insert a 500-high 20 layer and name it layer1.

5. Then place the cursor in the layer layer1, click on the menu [insert-layer] and insert a layer Layer2 500 high 130, and set the left and top margins of the Layer2 property to 0, and assign it a background color that you like.

6. Then repeat step 5, and then insert a layer layer3, this layer is no special use, in my tutorial, I just want to put a few buttons. Finally, I opened up as shown:

TIPS: The purpose here is to add a bezel to the front of the layer you want to slide, and only when clicked will the layer slide slowly from under your layer.

Now it's time to get into the process of making the sliding menu we're going to make today. 1

Now let's repeat step 5 above, insert a layer layer4, set the layer properties to width 500, 150 high, just the sum of the height of the layer2 and Layer3, and adjust the layer layer4 below the other two layers. As shown in figure:

Then we click on the layer Layer2 the front eye to let him close, so that we can see the layer layer4 underneath it.

At this point, we click Alt +f9 to open the Timeline panel, DW has added the default timeline Timeline1 for us, then we select the layer layer4 we want to slide, right-click on it, and select [Add to Timeline] At this point we can see in the timeline panel we have just developed the layer layer4, which shows that we have added success!

Then we click on the 15th frame on the timeline to adjust the top margin in the Layer4 property panel to 150. Here, a sliding layer even if you do, you can drag the timeline above the Red Square slowly from 1 to 15, you can see your this layer slowly from layer2 and layer3 sliding out!

Okay, now we just need to give this sliding layer layer4 set a motion that activates him. Even over: Before that, I've inserted a table on the Layer3 I added and set two buttons for layer4.

2

We first set the action to activate the sliding layer. Select the Expand this button, go to the Behavior panel, click on the Out menu to choose [Timeline--play timeline]dw will pop up a form, in the Drop-down menu above to select Timeline1.

Then confirm the event as onclick in the behavior panel

OK, here, you can preview, when you click on the expand button, your layer will slowly slide out from the top down!

How, see: We add a simple close action to the layer, that is, click the Close button to hide the layer. Select the Close button, go to the Behavior panel, click on the Out menu to choose [Show hidden Layer], select the Layer4 on the form, and click the Hide button below to set it to hidden, as shown:

OK, and then preview, and then click on the closed layer after the expansion is not: However, there seems to be a problem, click to expand again, it seems that there is no response, it is that we have an action not set.

Repeat the previous step 5, select the Expand button, add the action [timeline-go to the timeline], in the pop-up form of the Drop-down menu select Timeline1, the number of frames added to 1.

OK, this preview finds this problem solved. But we still seem to ignore a problem, click to close after the layer is set to hide, and then click to expand also did not respond. Or use the old way, to expand the button to add an action can be solved!

Repeat step 5, select Show hidden layer, and in contrast to step 6, this time we choose to display and confirm that the time to display hidden layers in the behavior panel is onclick. Now expand the button's behavior panel as shown in figure:


Okay, preview again, everything's fine!

So far, this effect even completed, of course, we can make a better performance of their own, but same, as long as we have mastered the use of time axes with action behavior, all the effect is only operational problems:



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.