jQuery中国地图显示公司位置全国分布代码,点击各省份弹窗显示对应介绍信息。
js代码
<script type="text/javascript">
$(function() {
if ($(".map-branch")) {
//默认显示上海
$(".map-dot.shanghai").addClass("cur");
$("#company_shanghai").show().css({
"left": $(".map-dot.shanghai").position().left + 36,
"top": $(".map-dot.shanghai").position().top - $("#company_shanghai").height() / 2 + 8
});
$(".map-dot").on("mouseover", function() {
$(this).addClass("cur").siblings(".map-dot").removeClass("cur");
});
$(".map-dot").on("click", function() {
$(this).addClass("cur").siblings(".map-dot").removeClass("cur");
var dataid = $(this).attr("data-id")
, comp = $("#company_" + dataid)
, otherComp = $("#company_" + dataid).siblings(".branch-map-data");
comp.fadeIn("fast").css({
"left": $(this).position().left + 36,
"top": $(this).position().top - comp.height() / 2 + 8
});
otherComp.hide();
});
$(".branch-map-data").on("mouseleave", function() {
$(this).hide();
$(".map-dot").removeClass("cur");
});
}
});
</script>
系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791