Core Code :
Copy code The Code is as follows: function cur (Ele ){
$ (Ele). addclass ("cur"). siblings (). removeclass ("cur ");
}
Function tab (id_tab, tag_tab, id_con, tag_con, Act ){
$ (Id_tab). Find (tag_tab). eq (0). addclass ("cur ");
$ (Id_con). Find (tag_con). eq (0). Show (). siblings (tag_con). Hide ();
If (! Act) {act = "click "};
If (Act = "click "){
$ (Id_tab). Find (tag_tab). Each (function (I ){
$ (Id_tab). Find (tag_tab). eq (I). Click (function (){
Cur (this );
$ (Id_con). Find (tag_con). eq (I). Show (). siblings (tag_con). Hide ();
})
})
}
If (Act = "Mouseover "){
$ (Id_tab). Find (tag_tab). Each (function (I ){
$ (Id_tab). Find (tag_tab). eq (I). Mouseover (function (){
Cur (this );
$ (Id_con). Find (tag_con). eq (I). Show (). siblings (tag_con). Hide ();
})
})
}
}
$ (Document). Ready (function (){
Tab ("# tri", "Li", "# game_con", "Div", "click ");
});
DEMO code: after running, you need to refresh to load jqueryXmlns = "http://www.w3.org/1999/xhtml">
- Baidu
- Foot home
- Server Software
Content jb51.net content s.jb51.net