Commit c670898f authored by daisy's avatar daisy

Merge branch 'master' into 'master'

update See merge request !1
parents 40c9e28c ba1683de
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="./css/common.css">
<script src="static/js/jquery-1.8.1.min.js" type=text/javascript></script>
<script src="static/js/flexible.js"></script>
<title>上海市人民检察院</title>
</head>
<style type="text/css">
/* 鼠标悬停时显示的tooltip样式 */
.tooltip {
position: absolute;
background-color: #333;
color: #fff;
padding: 5px;
border-radius: 5px;
display: none;
/* 初始时隐藏 */
}
</style>
<script type="text/javascript">
$(function () {
})
function handleClick(areaNumber) {
// 根据不同的区域执行不同的操作
switch (areaNumber) {
case 1:
alert('点击了区域 1');
// 执行区域 1 的操作
break;
case 2:
alert('点击了区域 2');
// 执行区域 2 的操作
break;
// 添加更多的 case 语句处理其他区域
}
}
function showTooltip(event, content) {
// 获取tooltip元素
var tooltip = document.getElementById('tooltip');
// 设置tooltip的内容
tooltip.innerHTML = content;
// 设置tooltip的位置
tooltip.style.left = event.pageX + 'px';
tooltip.style.top = event.pageY + 'px';
// 显示tooltip
tooltip.style.display = 'block';
}
function hideTooltip() {
// 隐藏tooltip
var tooltip = document.getElementById('tooltip');
tooltip.style.display = 'none';
}
</script>
<body>
<header class="header">
</header>
<div class="content">
<div class="login">
</div>
<img src="static/images/index1.png" usemap="#image-map">
<map name="image-map">
<area target="" alt="jianzu1" title="jianzu1" href="" coords="588,579,633,641"
onmouseover="showTooltip(event, 'Tooltip for Area 1')" onmouseout="hideTooltip()"
onclick="handleClick(1)" shape="rect">
<area target="" alt="jianzu2" title="jianzu2" href="" coords="667,565,708,620" onclick="handleClick(2)"
shape="rect">
<area target="" alt="jianzu3" title="jianzu3" href="" coords="708,687,669,641" shape="rect">
<area target="" alt="jianzu4" title="jianzu4" href="" coords="732,638,776,683" shape="rect">
<area target="" alt="jianzu5" title="jianzu5" href="" coords="758,564,803,618" shape="rect">
<area target="" alt="jianzu6" title="jianzu6" href="" coords="820,452,857,501" shape="rect">
<area target="" alt="jianzu7" title="jianzu7" href="" coords="834,536,869,587" shape="rect">
<area target="" alt="jianzu8" title="jianzu8" href="" coords="981,518,1015,564" shape="rect">
<area target="" alt="jianzu9" title="jianzu9" href="" coords="1066,644,1103,696" shape="rect">
<area target="" alt="jianzu10" title="jianzu10" href="" coords="1129,639,1171,686" shape="rect">
<area target="" alt="jianzu11" title="jianzu11" href="" coords="1241,662,1283,705" shape="rect">
</map>
</div>
</body>
</html>
\ No newline at end of file
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
!function ($) {
/**
* Description: jquery飘窗插件,可自适应浏览器宽高的变化
* Author: ddqre12345
* CreateTime: 2017.5.3
* param: args={startL:default, startT:default, angle:-Math.PI/4, speed: 125}
* 参数说名: startL飘窗初始时距离左边的距离, startT飘窗初始化距离顶部的距离, angle飘窗初始运动方向, speed运动速度(px/s)
*/
$.fn.autoMove = function (args) {
//先定义一些工具函数判断边距
function isTop(pos, w_w, w_h, d_w, d_h) {//飘窗到达上边距
return (pos.top <= 0) ? true : false;
}
function isBottom(pos, w_w, w_h, d_w, d_h) {//飘窗到达下边距
return (pos.top >= (w_h - d_h)) ? true : false;
}
function isLeft(pos, w_w, w_h, d_w, d_h) {//飘窗到达左边距
return (pos.left <= 0) ? true : false;
}
function isRight(pos, w_w, w_h, d_w, d_h) {//飘窗到达右边距
return (pos.left >= (w_w - d_w)) ? true : false;
}
return this.each(function () {
var w_w = parseInt($(window).width()),
w_h = parseInt($(window).height()),
d_w = parseInt($(this).width()),
d_h = parseInt($(this).height()),
d_l = (w_w - d_w) / 2,
d_t = (w_h - d_h) / 2,
max_l = w_w - d_w;
max_t = w_h - d_h;
//位置及参数的初始化
var setobj = $.extend({ startL: d_l, startT: d_t, angle: Math.PI / 4, speed: 100 }, args);
$(this).css({ position: 'absolute', left: setobj['startL'] + 'px', top: setobj['startT'] + 'px' });
var position = { left: setobj['startL'], top: setobj['startT'] };//飘窗位置对象
var that = $(this);
var angle = setobj.angle;
var time = 10;//控制飘窗运动效果,值越小越细腻
var step = setobj.speed * (time / 1000);//计算运动步长
var decoration = { x: step * Math.cos(angle), y: step * Math.sin(angle) };//计算二维上的运动增量
var mvtid;
$(window).on('resize', function () {//窗口大小变动时重新设置运动相关参数
w_w = parseInt($(window).width());
w_h = parseInt($(window).height());
max_l = w_w - d_w;
max_t = w_h - d_h;
});
function move() {
position.left += decoration.x;
position.top += decoration.y;
if (isLeft(position, w_w, w_h, d_w, d_h) || isRight(position, w_w, w_h, d_w, d_h)) {
decoration.x = -1 * decoration.x;
}
if (isRight(position, w_w, w_h, d_w, d_h)) {
position.left = max_l;
}
if (isTop(position, w_w, w_h, d_w, d_h) || isBottom(position, w_w, w_h, d_w, d_h)) {
decoration.y = -1 * decoration.y;
}
if (isBottom(position, w_w, w_h, d_w, d_h)) {
position.top = max_t;
}
//that.css({left:position.left, top:position.top});
that.animate({ left: position.left, top: position.top }, time);//改用jquery动画函数使其更加平滑
mvtid = setTimeout(move, time);//递归调用,使飘窗连续运动
}
move();//触发动作
that.on('mouseenter', function () { clearTimeout(mvtid) });//添加鼠标事件
that.on('mouseleave', function () { move() });
});
}; //end plugin definition
}(jQuery);
\ No newline at end of file
(function flexible(window, document) {
function resetFontSize() {
const size = (document.documentElement.clientWidth / 1920) * 37.5;
document.documentElement.style.fontSize = size + 'px';
}
// reset root font size on page show or resize
window.addEventListener('pageshow', resetFontSize);
window.addEventListener('resize', resetFontSize);
})(window, document);
This source diff could not be displayed because it is too large. You can view the blob instead.
/* jQuery分页插件sPage version:1.2.2 github:https://github.com/jvbei/sPage */
(function (p, t, e, a) {
"use strict";
var s = {
page: 1,
pageSize: 10,
total: 0,
showTotal: false,
totalTxt: "共{total}条",
noData: false,
showSkip: false,
showPN: true,
prevPage: "上一页",
nextPage: "下一页",
fastForward: 0,
backFun: function (t) { }
};
function i(t, e) {
this.element = p(t);
this.settings = p.extend({}, s, e);
this.pageNum = 1,
this.pageList = [],
this.pageTatol = 0;
this.init()
}
p.extend(i.prototype, {
init: function () {
this.element.empty();
this.viewHtml()
},
creatHtml: function (t) {
t == this.settings.page ? this.pageList.push('<button class="active" data-page=' + t + ">" + t + "</button>") : this.pageList.push("<button data-page=" + t + ">" + t + "</button>")
},
viewHtml: function () {
var t = this.settings;
var e = 0;
var a = [];
if (t.total > 0) {
e = Math.ceil(t.total / t.pageSize)
} else {
if (t.noData) {
e = 1;
t.page = 1;
t.total = 0
} else {
return
}
}
this.pageTatol = e;
this.pageNum = t.page;
if (t.showTotal) {
a.push('<div class="spage-total">' + t.totalTxt.replace(/\{(\w+)\}/gi, t.total) + "</div>")
}
a.push('<div class="spage-number">');
this.pageList = [];
if (t.showPN) {
t.page == 1 ? this.pageList.push('<button class="button-disabled" data-page="prev">' + t.prevPage + "</button>") : this.pageList.push('<button data-page="prev">' + t.prevPage + "</button>")
}
if (e <= 6) {
for (var s = 1; s < e + 1; s++) {
this.creatHtml(s)
}
} else {
if (t.page < 5) {
for (var s = 1; s <= 5; s++) {
this.creatHtml(s)
}
this.pageList.push('<button data-page="after" class="spage-after">...</button><button data-page=' + e + ">" + e + "</button>")
} else if (t.page > e - 4) {
this.pageList.push('<button data-page="1">1</button><button data-page="before" class="spage-before">...</button>');
for (var s = e - 4; s <= e; s++) {
this.creatHtml(s)
}
} else {
this.pageList.push('<button data-page="1">1</button><button data-page="before" class="spage-before">...</button>');
for (var s = t.page - 2; s <= Number(t.page) + 2; s++) {
this.creatHtml(s)
}
this.pageList.push('<button data-page="after" class="spage-after">...</button><button data-page=' + e + ">" + e + "</button>")
}
}
if (t.showPN) {
t.page == e ? this.pageList.push('<button class="button-disabled" data-page="next">' + t.nextPage + "</button>") : this.pageList.push('<button data-page="next">' + t.nextPage + "</button>")
}
a.push(this.pageList.join(""));
a.push("</div>");
if (t.showSkip) {
a.push('<div class="spage-skip">跳至&nbsp;<input type="text" value="' + t.page + '"/>&nbsp;页&nbsp;&nbsp;<button data-page="go">确定</button></div>')
}
this.element.html(a.join(""));
this.clickBtn()
},
clickBtn: function () {
var a = this;
var s = this.settings;
var i = this.element;
var n = this.pageTatol;
this.element.off("click", "button");
this.element.on("click", "button", function () {
var t = p(this).data("page");
switch (t) {
case "prev":
s.page = s.page - 1 >= 1 ? s.page - 1 : 1;
t = s.page;
break;
case "next":
s.page = Number(s.page) + 1 <= n ? Number(s.page) + 1 : n;
t = s.page;
break;
case "before":
s.page = s.page - s.fastForward >= 1 ? s.page - s.fastForward : 1;
t = s.page;
break;
case "after":
s.page = Number(s.page) + Number(s.fastForward) <= n ? Number(s.page) + Number(s.fastForward) : n;
t = s.page;
break;
case "go":
var e = parseInt(i.find("input").val());
if (/^[0-9]*$/.test(e) && e >= 1 && e <= n) {
s.page = e;
t = e
} else {
return
}
break;
default:
s.page = t
}
if (t == a.pageNum) {
return
}
a.pageNum = s.page;
a.viewHtml();
s.backFun(t)
});
this.element.off("keyup", "input");
this.element.on("keyup", "input", function (t) {
if (t.keyCode == 13) {
var e = parseInt(i.find("input").val());
if (/^[0-9]*$/.test(e) && e >= 1 && e <= n && e != a.pageNum) {
s.page = e;
a.pageNum = e;
a.viewHtml();
s.backFun(e)
} else {
return
}
}
});
if (s.fastForward > 0) {
i.find(".spage-after").hover(function () {
p(this).html("&raquo;")
}, function () {
p(this).html("...")
});
i.find(".spage-before").hover(function () {
p(this).html("&laquo;")
}, function () {
p(this).html("...")
})
}
}
});
p.fn.sPage = function (t) {
return this.each(function () {
new i(this, t)
})
}
}
)(jQuery, window, document);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment