Home > Web Front-end > JS Tutorial > js json uses tables to implement simple website left navigation_json

js json uses tables to implement simple website left navigation_json

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 18:30:25
Original
1440 people have browsed it

The call is very simple, just organize the data into json format: The format is as follows:

Copy code The code is as follows:

window.onload = function()
{
var tf="if1";
var data=[{m:"Sports Website",s:[{sn:"Baidu Sports ",st:"http://news.baidu.com/n?cmd=1&class=sportnews"},
{sn:"Sohu Sports",st:"http://sports.sohu.com/" },
{sn:"Sina Sports",st:"http://sports.sina.com.cn/"}]},
{m:"News Website",s:[{sn: "Baidu",st:"http://news.baidu.com/"},
{sn:"Sohu",st:"http://news.sohu.com/"},
{ sn:"Sina",st:"http://news.sina.com.cn/"}]},
{m:"Video website",s:[{sn:"Baidu Video",st: "http://vedio.baidu.com/"},
{sn:"Sohu Video",st:"http://tv.sohu.com/"},
{sn:"Sina Video ",st:"http://vedio.sina.com.cn/"}]}
];
var nav=new tableNav("table1",data,tf);
var bautoClose= false; //Whether other navigation bars are closed when the current navigation bar is opened
nav.generateNav(bautoClose);
}

The entire example code is as follows: for beginners to learn!
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Backslash present in Json
From 1970-01-01 08:00:00
0
0
0
Get: Transfer JSON data
From 1970-01-01 08:00:00
0
0
0
mysql storage json error
From 1970-01-01 08:00:00
0
0
0
javascript - Problems with displaying json data
From 1970-01-01 08:00:00
0
0
0
Find matching integers in JSON.
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template