: Different buttons on the same page display different DIV layer effects

Source: Internet
Author: User
: Different buttons on the same page display different DIV layer effects HI everyone. when encountering a function similar to this, there are multiple buttons on the same page and you need to click different buttons, different layers are shown below. the buttons are based on the database information, and the content below is based on the clicked button information.
Thank you!


Reply to discussion (solution)

Let's take a look !!!!!

Baidu: html tab to see if you need
Dynamic data is a loop.

It is not a tab. Because it is a button control

Baidu: html tab to see if you need
Dynamic data is a loop.


It is not a tab. Because it is a button control

If p is used for the tab, add a button to the button and put the onclick event on the button.

JavaScript control + ajax requests different data.

JavaScript control + ajax requests different data.

Can I see examples? Thank you.

For help ..! Is there an example?

First, write down the number of buttons (js controls p to hide something), and then dynamically retrieve the number of databases ..








Script
// Select a calculator event
Function ShowDiv (obj) {// obtain all the values of p 1-7
// Global variable
Var ps = [];
Var pCnt = 7; // The number of p
// Obtain the document
For (var I = 1; I <7; I ++ ){
Ps [I] = document. getElementById ("p" + (I + 1 ));
Ps [I]. style. display = "none ";
}

Document. getElementById (obj). style. display = "block"; // display the current p

}
Script

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.