QiFeng.ZWY.MagWeb/Content/ProportionDiagram/js/guide.js
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
if (!window.baseJs) window.baseJs = {};
(function () {
function map(options, callback) {
this.handleData = arguments[1];
var defaultOptions = {
type: 2,
/* 坐标数组 */
data: [],
/* div大小 */
size: 100,
/* 用于临时保存之前创建的div */
divTemp: [],
rem: parseInt(document.documentElement.style.fontSize)
}
this.i = 0;
this.options = $.extend({}, defaultOptions, options);
this.init();
}
map.prototype = {
init: function () {
var mapId = document.querySelector('#map'),
imgW = mapId.clientWidth,
imgH = mapId.clientHeight;
$('.map-wrap').css({
'width': imgW + 'px',
'height': imgH + 'px',
'margin': '0 auto'
});
this.bindEvent();
},
bindEvent: function () {
var self = this;
$('header,.route,.my-site,.nav-bar').remove();
$('.main').css('padding', 0);
this.fillScenicOnMap(this.options.size);
$('#map').on('click', function (e) {
e = e || window.event;
var site = self.getClickSiteOnImg(e);
/* 删除前一次创建的div */
$(self.options.divTemp[0]).remove();
self.options.divTemp = [];
var div0 = self.createDiv({
uid: 'ss',
x: site.x,
y: site.y,
size: self.options.size
});
div0.css('background', '#ffff00');
$('.map-wrap').append(div0);
self.options.divTemp.push(div0);
if (self.handleData) self.handleData(site);
});
$('.map-wrap').on('click', '.scenic', function (e) {
var thisDiv = this;
var xx = $(this).attr('x');
var yy = $(this).attr('y');
var Id = $('#Id').val();
if (Id === "0") {
window.location.href = "/ScenicSpots/AddScenicSpots?x=" + xx + "&y=" + yy;
} else {
后面还有 111 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。