: 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