<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jQuery檢測滾動條距離頂部的高度 - 開優網絡 - www.568387.com</title> <style> *{font-family: microsoft yahei;padding:0;margin:0;list-style:none;} #navigation { position: fixed; top: -66px; left: 0; right: 0; width: 100%; height: 60px; background-color: #006699; -webkit-box-shadow: 0px 3px 3px 0px rgba(21, 21, 21, 0.1); box-shadow: 0px 3px 3px 0px rgba(21, 21, 21, 0.1); -webkit-transition: top .25s ease .5s; transition: top .25s ease .5s; } #navigation p { text-align: center; color: #fff; line-height:60px; } #percentageCounter { position: fixed; bottom: 10px; right: 10px; } h1 {font-size: +2em;} .content { width: 40%; margin:50px auto; padding:25px; color:#fff; background-color:#0082c3; border-radius:5px; } p {margin-bottom: 1em;text-indent:2em;line-height:2;font-family:microsoft yahei;} </style> </head> <body> <div id="navigation"> <p>開優網絡 - www.568387.com 南昌網站開發</p> </div> <div id="percentageCounter"><h1>0%</h1></div> <div class="content"> <p>南昌開優網絡有一支年輕有朝氣、充滿活力與創造力的團隊,每位工作人員都在各自的陣地上有著出色的表現以及豐富的實戰經驗,主要致力于為企業及個人提供專業優質的互聯網服務;綜合網站建設、網站SEO、網絡營銷、推廣維護等項目為一身,涉及機械、醫療、學校、服裝、美容、房產等行業的互聯網媒介服務。</p> <p>我們的特色:原創性代碼,絕不套用模板,每一個代碼都是經過精心推敲、思考,讓您的網站不再平庸!我們將為您提供專業、優質網站建設服務,用非凡的創意和嫻熟的技術,生成最具性價比的網站解決方案。</p> <p>在網絡飛速發展的今天,各類大大小小的網絡公司司空見慣,我們的團隊都是來自大型網絡公司的精英,一路走來我們不斷提高專業能力,為客戶提供更優質的服務,使我們和客戶保持著穩定與和諧發展的服務關系。選擇我們,我們會做的更好!</p> <p>想要為您量身定制網站? 沒問題,我們有專業的網站開發團隊!</p> <p>不會設計/策劃網站形象界面? 別擔心,我們有優秀的網頁設計師!</p> <p>擔心網站安全性沒有保障? 您放心,我們有專業的網站程序工程師!</p> <p>產品與服務排名不好帶不來客戶? 請相信,我們有資深的網站SEO工程師和推廣專家!</p> <p>沒有完整的企業營銷方案策略?相信南昌開優網絡工作室是您不二的選擇!</p> <p>我們承諾:花最少的錢,為您提供最完善的服務體系!</p> </div> <script src='js/jquery.js'></script> <script> $(window).scroll(function(){ var targetPercentage = 70; var navBarHeight = 66; var targetID = "#navigation"; var scrollTo = $(window).scrollTop(), docHeight = $(document).height(), windowHeight = $(window).height(); scrollPercent = (scrollTo / (docHeight-windowHeight)) * 100; scrollPercent = scrollPercent.toFixed(1); $('#percentageCounter h1').text(scrollPercent+"%"); if(scrollPercent > targetPercentage){ $(targetID).css({top:'0'}); } if(scrollPercent < targetPercentage){ $(targetID).css({ top: '-'+navBarHeight+'px' }); } }).trigger('scroll'); </script> </body> </html>