| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- $(function(){
-
- //头部导航
- var navTitle = new Vue({
- el:"#header_nav_list",
- data:{
- items:[]
- }
- })
- $.ajax({
- url:"./json/1.json",
- type:"get",
- dataType:"json",
- success:function(msg){
- navTitle.items = msg;
- }
- })
- //头部二级导航
- var navTitle2 = new Vue({
- el:"#header_sed_nav_con",
- data:{
- items:[]
- }
- })
- $.ajax({
- url:"./json/2.json",
- type:"get",
- dataType:"json",
- success:function(msg){
- navTitle2.items = msg;
- }
- })
- //footer
- var footerMsg = new Vue({
- el:"#footer",
- data:{
- footerTitle:[],
- footerContent:[]
- }
- })
- $.ajax({
- url:"./json/footer.json",
- type:"get",
- dataType:"json",
- success:function(msg){
- footerMsg.footerTitle = msg.title;
- footerMsg.footerContent = msg.content;
- }
- })
- window.addEventListener("load",function(){
- //导航
- $("#header_nav_list>li").mouseover(function(event){
- var num = $(this).index();
- $("#header_sed_nav_con ul").eq(num).css("display","block").siblings("ul").css("display","none");
-
- $("#header_sed_nav_con ul").eq(num).mouseover(function(event){
- $("#header_sed_nav_con ul").eq(num).css("display","block").siblings("ul").css("display","none");
- event.stopPropagation();
- })
- event.stopPropagation();
- })
- $('#header_nav_list>li').mouseout(function(event){
- $('#header_sed_nav_con ul').css('display','none');
- $('#header_sed_nav_con ul').mouseout(function(event){
- $(this).css('display','none');
- event.stopPropagation();
- });
- event.stopPropagation();
- });
- })
- })
|