这段代码在内部文件种可以使用(加载的效果功能什么都可以),但是放到外部文件里就没反应了
代码如下:
<script src="../assets/global/scripts/jqnav.js" type="text/javascript"></script>
$(function(){
alert("已经调用到");
$("#region_statistics_content").css("height",$("#remap").css("height"));
$(window).resize(function(){
$("#region_statistics_content").css("height",$("#remap").css("height"));
});
$(".message_close").click(function(){
$(".city_message").hide();
});
$(".city a").click(function(){
$(".city_message").show();
})
$.post('<?=site_url('Agentmap/province_agent_status')?>',function(data){
var dataobj = eval("("+data+")");
console.log(dataobj);
if(dataobj.none.length){
for(var i=0;i<dataobj.none.length;i++){
。。。。 }
if (dataobj.yet.length) {
for(var i=0;i<dataobj.yet.length;i++){
console.log(dataobj.yet[i].region_name);
switch(dataobj.yet[i].region_name){
case "安徽":
$(".anhui").css("background-image","url(../assets/global/img/images/anhui3.png)");break;
case "内蒙古":
$(".neimeng").css("background-image","url(../assets/global/img/images/neimeng3.png)");break;
case "黑龙江":
$(".heilongjiang").css("background-image","url(../assets/global/img/images/heilongjiang3.png)");break;
case "新疆":
$(".xinjiang").css("background-image","url(../assets/global/img/images/xinjiang3.png)");break;
case "西藏":
$(".xizang").css("background-image","url(../assets/global/img/images/xizang3.png)");break;
case "青海":
$(".qinghai").css("background-image","url(../assets/global/img/images/qinghai3.png)");break;
case "甘肃":
$(".gansu").css("background-image","url(../assets/global/img/images/gansu3.png)");break;
case "宁夏":
$(".ningxia").css("background-image","url(../assets/global/img/images/ningxia3.png)");break;
case "上海":
$(".shanghai").css("background-image","url(../assets/global/img/images/shanghai3.png)");break;
case "辽宁":
$(".liaoning").css("background-image","url(../assets/global/img/images/liaoning3.png)");break;
case "广东":
$(".guangdong").css("background-image","url(../assets/global/img/images/guangdong3.png)");break;
case "广西":
$(".guangxi").css("background-image","url(../assets/global/img/images/guangxi3.png)");break;
case "河南":
$(".henan").css("background-image","url(../assets/global/img/images/henan3.png)");break;
case "陕西":
$(".shanxi").css("background-image","url(../assets/global/img/images/shanxi3.png)");break;
case "山西":
$(".shanxi1").css("background-image","url(../assets/global/img/images/shanxi2_3.png)");break;
case "河北":
$(".hebei").css("background-image","url(../assets/global/img/images/hebei3.png)");break;
case "吉林":
$(".jilin").css("background-image","url(../assets/global/img/images/jilin3.png)");break;
case "北京":
$(".beijing").css("background-image","url(../assets/global/img/images/beijing3.png)");break;
case "天津":
$(".tianjin").css("background-image","url(../assets/global/img/images/tianjin3.png)");break;
case "山东":
$(".shandong").css("background-image","url(../assets/global/img/images/shandong3.png)");break;
case "江苏":
$(".jiangsu").css("background-image","url(../assets/global/img/images/jiangsu3.png)");break;
case "海南":
$(".hainan").css("background-image","url(../assets/global/img/images/hainan3.png)");break;
case "湖北":
$(".hubei").css("background-image","url(../assets/global/img/images/hubei3.png)");break;
case "云南":
$(".yunnan").css("background-image","url(../assets/global/img/images/yunnan3.png)");break;
case "四川":
$(".sichuan").css("background-image","url(../assets/global/img/images/sichuan3.png)");break;
case "贵州":
$(".guizhou").css("background-image","url(../assets/global/img/images/guizhou3.png)");break;
case "台湾":
$(".taiwan").css("background-image","url(../assets/global/img/images/taiwan3.png)");break;
case "福建":
$(".fujian").css("background-image","url(../assets/global/img/images/fujian3.png)");break;
case "湖南":
$(".hunan").css("background-image","url(../assets/global/img/images/hunan3.png)");break;
case "浙江":
$(".zhejiang").css("background-image","url(../assets/global/img/images/zhejiang3.png)");break;
case "江西":
$(".jiangxi").css("background-image","url(../assets/global/img/images/jiangxi3.png)");break;
case "重庆":
$(".chongqing").css("background-image","url(../assets/global/img/images/chongqing3.png)");break;
}
}
}
})
})
风之流动
风之流动
相关分类