diff --git a/.gitignore b/.gitignore index 7b2c018..a343e86 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ # precompiled files .precomp lib/.precomp +image/青海/1.mp4 +image/西藏/1.mp4 +image/新疆/1.mp4 diff --git a/demo.html b/demo.html index 4cb785c..642c3dc 100644 --- a/demo.html +++ b/demo.html @@ -25,38 +25,26 @@
- +
- +
- +
- +
- -
-
- -
-
- -
-
- -
-
- +
@@ -1101,6 +1089,8 @@ category = 1 symbolSize = 40 init(city) + loadPic(city) + loadVideo(city) }); myChart.setOption(option); @@ -1273,7 +1263,7 @@ optionGraph.series[0].links = Object.values(currentGraph.links); myChartGraph.setOption(optionGraph); } - + const optionGraph = { title: { title:'知识图谱', @@ -1354,6 +1344,7 @@ } }] }; + init("西藏") myChartGraph.on('click', function(params) { if (params.dataType === "node") { const node = nodeMap[params.data.name]; @@ -1366,6 +1357,41 @@ } }); +// 点击省份加载图片 + function loadPic(name) { + if (name == "西藏" || name == "新疆" || name == "青海") { + temp = 1 + } + else { + name = "西藏" + } + $("img").each(function(index){ + newPath = "./image/"+name+"/"+(index+1)+".jpg" + $(this).attr("src", newPath) + // alert(index) + + }); + } +// 点击省份加载视频 +function loadVideo(name) { + if (name == "西藏" || name == "新疆" || name == "青海") { + temp = 1 + } + else { + name = "西藏" + } + $("video").remove(); + var newPath = "./image/"+name+"/1.mp4" + var newSource = "
"+ + ""+ + "
" + $(".div-c").prepend(newSource) + } +