$(function () { // let base = 'http://119.23.129.199:8100/' let base = '/' var stopClick = false function getQueryString (value) { var reg = new RegExp('(^|&)' + value + '=([^&]*)(&|$)', 'i') var r = window.location.search.substr(1).match(reg) if (r != null) return unescape(r[2]); return null } $('#canvas').attr('width', $('#canvasWrap').width()) $('#canvas').attr('height', $('#canvasWrap').height()) init() $('#clear').click(function () { $('#clear').css('opacity', 0) $('#result').html('') }) $('#clsipt').click(function () { $('#input').val('') $('#clsipt').css('opacity', 0) $('.search-page').show() $('.result-page').hide() }) $('#input').on('input propertychange', function () { var count = $(this).val().length $('#clsipt').css('opacity', count ? 1 : 0) }) $('#search').click(function () { search() }) $('#reload').click(function () { location.reload() }) let startY = '' let lastY = '' let mMove = function (event) { event.stopPropagation() event.preventDefault() let deltaY = event.clientY - startY stopClick = true if (lastY == deltaY) { return } let de = document.documentElement.scrollTop || document.body.scrollTop dic = lastY > deltaY ? 1 : -1 let to = de + dic * 15 window.scrollTo(0, to) // lastY>deltaY?window.scrollTo(deltaY):'δΈ‹' lastY = deltaY } $('.body').mousedown(function (e) { startY = e.clientY stopClick = false $('.body').mousemove(mMove) }) $('.body').mouseup(function (e) { $('.body').off('mousemove', mMove) }) function callbackfunc (ret) { let html = '' ret.cand.forEach(item => { html += `