{"id":3388,"date":"2019-12-11T12:03:34","date_gmt":"2019-12-11T04:03:34","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=3388"},"modified":"2019-12-11T12:35:11","modified_gmt":"2019-12-11T04:35:11","slug":"%e8%bf%94%e5%9b%9e%e9%a1%b6%e9%83%a8%e7%ae%80%e6%98%93%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/3388.html","title":{"rendered":"\u8fd4\u56de\u9876\u90e8\u7b80\u6613\u4ee3\u7801"},"content":{"rendered":"

\u8fd4\u56de\u9876\u90e8\u7b80\u6613\u4ee3\u7801<\/h2>\n

\u6211\u4eec\u5728\u505a\u7f51\u7ad9\u7684\u65f6\u95f4\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u8fd4\u56de\u9876\u90e8\u7684\u6548\u679c\uff0c\u9f20\u6807\u6eda\u52a8\u4e00\u5b9a\u9ad8\u5ea6\u4e4b\u540e\uff0c\u4f1a\u51fa\u73b0\u201c\u8fd4\u56de\u9876\u90e8\u201d\u7684\u6807\u7b7e\u3002\u201c\u8fd4\u56de\u9876\u90e8\u201d\u6807\u7b7e\u88ab\u56fa\u5b9a\u5230\u7a97\u53e3\u7684\u6307\u5b9a\u4f4d\u7f6e\uff0c\u4f4d\u7f6e\u59cb\u7ec8\u4e0d\u53d8\u3002\u5f53\u6eda\u52a8\u7684\u8ddd\u79bb\u9ad8\u5ea6\u5c0f\u4e8e\u6307\u5b9a\u9ad8\u5ea6\u540e\uff0c\u8be5\u201c\u8fd4\u56de\u9876\u90e8\u201d\u7684\u6807\u7b7e\u6d88\u5931\u3002\u53e6\u5916\uff0c\u201c\u8fd4\u56de\u9876\u90e8\u6807\u7b7e\u201d\u7ed1\u5b9a\u70b9\u51fb\u4e8b\u4ef6\uff0c\u901a\u8fc7\u9f20\u6807\u70b9\u51fb\uff0c\u5b9e\u73b0\u6587\u6863\u56de\u5230\u9876\u90e8\u7684\u6548\u679c\u3002<\/p>\n

\"\"<\/a><\/p>\n

\u4ee3\u7801\u4e00<\/h2>\n
<!DOCTYPE html>\r\n<html>\r\n \r\n\t<head>\r\n\t\t<meta charset=\"UTF-8\">\r\n\t\t<title>\u8fd4\u56de\u9876\u90e8<\/title>\r\n\t\t<style type=\"text\/css\">\r\n\t\t\t* {\r\n\t\t\t\tpadding: 0;\r\n\t\t\t\tmargin: 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.header {\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\theight: 100px;\r\n\t\t\t\tbackground: gray;\r\n\t\t\t\ttext-align: center;\r\n\t\t\t\tfont-size: 20px;\r\n\t\t\t\tline-height: 100px;\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\tleft: 0;\r\n\t\t\t\tright: 0;\r\n\t\t\t\ttop: 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.content {\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\theight: 1500px;\r\n\t\t\t\tbackground: blueviolet;\r\n\t\t\t\ttext-align: center;\r\n\t\t\t\tfont-size: 20px;\r\n\t\t\t\tpadding-top: 100px;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.footer {\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\theight: 100px;\r\n\t\t\t\tbackground: grey;\r\n\t\t\t\ttext-align: center;\r\n\t\t\t\tfont-size: 20px;\r\n\t\t\t\tline-height: 100px;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.toTop {\r\n\t\t\t\twidth: 70px;\r\n\t\t\t\theight: 70px;\r\n\t\t\t\tborder-radius: 50%;\r\n\t\t\t\tbackground: greenyellow;\r\n\t\t\t\ttext-align: center;\r\n\t\t\t\tline-height: 70px;\r\n\t\t\t\t\/*\u8fd4\u56de\u9876\u90e8\u6807\u7b7e\u56fa\u5b9a\u5b9a\u4f4d*\/\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\tright: 35px;\r\n\t\t\t\tbottom: 35px;\r\n\t\t\t\tz-index: 999;\r\n\t\t\t\tfont-size: 14px;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.toTop:hover {\r\n\t\t\t\tbackground: green;\r\n\t\t\t\tfont-size: 16px;\r\n\t\t\t\tcursor: pointer;\r\n\t\t\t\tcolor: red;\r\n\t\t\t}\r\n\t\t<\/style>\r\n\t<\/head>\r\n \r\n\t<body>\r\n\t\t<div class=\"wrapper\">\r\n\t\t\t<div class=\"header\">\u9876\u90e8\u5bfc\u822a\u680f\u90e8\u5206<\/div>\r\n\t\t\t<div class=\"content\">\r\n\t\t\t\t<p>div.wrapper>(div.header+div.content+div.footer+div.toTop)\u5feb\u901f\u751f\u6210\u4ee3\u7801<\/p>\r\n\t\t\t\t<p>content\u90e8\u5206\u7684\u9ad8\u5ea6\u5927\u4e8e\u5c4f\u5e55\u7684\u9ad8\u5ea6\uff0c\u4ec5\u4ec5\u662f\u4e3a\u4e86\u51fa\u73b0\u6eda\u52a8\u6761\u800c\u5df2\u3002<\/p>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"footer\">\u5e95\u90e8<\/div>\r\n\t\t\t<div class=\"toTop\">\u56de\u9876\u90e8<\/div>\r\n\t\t<\/div>\r\n\t<\/body>\r\n \r\n<\/html>\r\n<script src=\"http:\/\/libs.baidu.com\/jquery\/2.0.0\/jquery.min.js\"><\/script>\r\n<script type=\"text\/javascript\">\r\n\t$(document).ready(function() {\r\n\t\t\/\/ \u521d\u59cb\u65f6\uff0c\u201c\u8fd4\u56de\u9876\u90e8\u201d\u6807\u7b7e\u9690\u85cf\r\n\t\t$(\".toTop\").hide();\r\n\t\t$(window).scroll(function() {\r\n\t\t\t\/\/ \u82e5\u6eda\u52a8\u7684\u9ad8\u5ea6\uff0c\u8d85\u51fa\u6307\u5b9a\u7684\u9ad8\u5ea6\u540e\uff0c\u201c\u8fd4\u56de\u9876\u90e8\u201d\u7684\u6807\u7b7e\u51fa\u73b0\u3002\r\n\t\t\tif($(document).scrollTop() >= 150) {\r\n\t\t\t\t$(\".toTop\").show();\r\n\t\t\t} else {\r\n\t\t\t\t$(\".toTop\").hide();\r\n\t\t\t}\r\n\t\t})\r\n\t\t\/\/ \u7ed1\u5b9a\u70b9\u51fb\u4e8b\u4ef6\uff0c\u5b9e\u73b0\u8fd4\u56de\u9876\u90e8\u7684\u6548\u679c\r\n\t\t$(\".toTop\").click(function() {\r\n\t\t\t$(document).scrollTop(0);\r\n\t\t})\r\n \r\n\t})\r\n<\/script><\/code><\/pre>\n

\u4ee3\u7801\u4e8c<\/h2>\n

\u6548\u679c<\/p>\n

\"\"<\/a><\/p>\n

js\u6587\u4ef6<\/p>\n

(function() {\r\n    var btnId = '__gotop';\r\n    var isIE = !!window.ActiveXObject && \/msie (\\d)\/i.test(navigator.userAgent) ? RegExp['$1'] : false;\r\n\r\n    function $() {\r\n        return document.getElementById(arguments[0]);\r\n    }\r\n\r\n    function getScrollTop() {\r\n        return ('pageYOffset' in window) ? window.pageYOffset\r\n            : document.compatMode === \"BackCompat\"\r\n            && document.body.scrollTop\r\n            || document.documentElement.scrollTop ;\r\n    }    \r\n\r\n    function bindEvent(event, func) {\r\n        if (window.addEventListener) {\r\n            window.addEventListener(event, func, false);\r\n        } else if (window.attachEvent) {\r\n            window.attachEvent('on' + event, func);\r\n        }\r\n    }\r\n\r\n    bindEvent('load',\r\n        function() {\r\n            var css = 'background-color:#999;width:50px;height:50px;position:fixed;right:100px;bottom:30px;border-radius:10px;cursor:pointer;display:none;';\r\n\r\n            if (isIE && isIE < 7) {\r\n                css += '_position:absolute;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-30-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)))';\r\n                var style = document.createStyleSheet();\r\n                style.cssText = '*html{background-image:url(about:blank);background-attachment:fixed;}';\r\n            }\r\n\r\n            var html = '<div style=\"height: 0;width: 0;border:14px solid #999999;border-top: 0 none;border-bottom:14px solid #fff;position: relative;margin:12px 0 0 11px;\"><div style=\"width:8px;height:7px;position:absolute;top:14px;left:-4px;background-color:#fff;overflow: hidden;\"><\/div><\/div>';\r\n            var el = document.createElement('DIV');\r\n            el.id = btnId;\r\n            el.style.cssText = css;\r\n            el.innerHTML = html;\r\n            document.body.appendChild(el);\r\n\r\n            el.onclick = function() {\r\n                (function() {\r\n                    var top = getScrollTop();\r\n                    if (top > 0) {\r\n                        window.scrollTo(0, top \/ 1.2)\r\n                        setTimeout(arguments.callee, 10);\r\n                    }\r\n                })();\r\n            };\r\n\r\n            el.onmouseover = function() {\r\n                $(btnId).firstChild.style.borderBottom = '14px solid #ddd';\r\n                $(btnId).firstChild.firstChild.style.backgroundColor = '#ddd';\r\n            };\r\n\r\n            el.onmouseout = function() {\r\n                $(btnId).firstChild.style.borderBottom = '14px solid #fff';\r\n                $(btnId).firstChild.firstChild.style.backgroundColor = '#fff';\r\n            };\r\n        }\r\n    );\r\n\r\n    bindEvent('scroll',\r\n        function() {\r\n            var top = getScrollTop(), display = 'none';\r\n\r\n            if (top > 0) {\r\n                display = 'block';\r\n            }\r\n\r\n            if ($(btnId)) $(btnId).style.display = display;\r\n        });\r\n})();<\/code><\/pre>\n

html<\/p>\n

<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\r\n <head>\r\n   <meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/>\r\n   <title>\u8fd4\u56de\u9876\u90e8\u6309\u94ae<\/title>\r\n   <meta name=\"keywords\" content=\"\"\/>\r\n   <meta name=\"Description\" content=\"\"\/>\r\n   \r\n   <script type=\"text\/javascript\" src=\"abc.js\"><\/script>\r\n <\/head>\r\n <body style=\"height:2000px;\">\r\n  <\/body>\r\n<\/html><\/code><\/pre>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

\u8fd4\u56de\u9876\u90e8\u7b80\u6613\u4ee3\u7801 \u6211\u4eec\u5728\u505a\u7f51\u7ad9\u7684\u65f6\u95f4\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u8fd4\u56de\u9876\u90e8\u7684\u6548\u679c\uff0c\u9f20\u6807\u6eda\u52a8\u4e00\u5b9a\u9ad8\u5ea6\u4e4b\u540e\uff0c\u4f1a\u51fa\u73b0\u201c\u8fd4\u56de\u9876\u90e8\u201d\u7684\u6807\u7b7e […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1127,1126],"class_list":["post-3388","post","type-post","status-publish","format-standard","hentry","category-web","tag-1127","tag-1126"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/3388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=3388"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/3388\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=3388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=3388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=3388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}