js平滑滾動到頂部,底部,指定地方,seo建站技術(shù)
導(dǎo)讀:seo建站技術(shù)seo建站技術(shù)采用錨點(diǎn)進(jìn)行頁面中的跳轉(zhuǎn)的確很方便,但是要想增加網(wǎng)頁的效果,可以使用jquery中的animate,實(shí)現(xiàn)滾動的一個(gè)動作,慢慢的滾動到你想跳轉(zhuǎn)到的位置,從而看起來建站的技術(shù)網(wǎng)站怎么搭建。
采用錨點(diǎn)進(jìn)行頁面中的跳轉(zhuǎn)的確很方便,但是要想增加網(wǎng)頁的效果,可以使用jquery中的animate,實(shí)現(xiàn)滾動的一個(gè)動作,慢慢的滾動到你想跳轉(zhuǎn)到的位置,從而看起來會非常高大上。
滾動到頂部:
$('.scroll_top').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);});滾動到指定位置:
$('.scroll_a').click(function(){$('html,body').animate({scrollTop:$('.a').offset().top}, 800);})織夢模板修改;示例演示地址:http://www.daixiaorui.com/Public/demo/js/scroll.html
源碼參考:
<!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>js平滑滾動到頂部、底部、指定地方</title> <script type="text/javascript" src="http://www.daixiaorui.com/Public/js/jquery.min.js"></script> <style> .box{ height:200px; width:100%; background:#ccc; margin:10px 0;} .location{ position:fixed; right:0; bottom:10px; width:20px; background:#FFC; padding:5px; cursor:pointer;color:#003}; </style> </head> <body> <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box a">產(chǎn)品介紹產(chǎn)品介紹 http://www.daixiaorui.com 產(chǎn)品介紹產(chǎn)品介紹產(chǎn)品介紹產(chǎn)品介紹產(chǎn)品介紹產(chǎn)品介紹產(chǎn)品介紹產(chǎn)品介紹產(chǎn)品介紹產(chǎn)品介紹產(chǎn)品介紹</div> <div class="box"></div> <div class="box"></div> <d夢織模板iv class="box"></div> <div class="box"></div> <div class="box bottom"></div> <div class="location"> ?<p class="scroll_top">返回頂部</p> ?<p class="scroll_a">產(chǎn)品介紹</p> ?<p class="scroll_bottom">滑到底部</p> </div> <script type="text/javascript"> jQuery(document).ready(function($){ $('.scroll_top').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);});? $('.scroll_a').click(function(){$('html,body').animatdede模板堂e({scrollTop:$('.a').offset().top}, 800);}); $('.scroll_bottom').click(function(){$('html,body').animate({scrollTop:$('.bottom').offset().top}, 800);}); }); </script> </body> </html>文章出自:www.daixiaorui.com?非本站原創(chuàng)!
相關(guān)建站的技術(shù)網(wǎng)站怎么搭建。聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-07-23 ,文章js平滑滾動到頂部,底部,指定地方,seo建站技術(shù)主要講述平滑,地方,建站網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請保留鏈接: http://www.bifwcx.com/article/web_35425.html
為你推薦與js平滑滾動到頂部,底部,指定地方,seo建站技術(shù)相關(guān)的文章
-
通王TWCMS 2.0.3網(wǎng)站模板程序下載
(126)人喜歡 2024-01-15 -
Windows官方原版在哪里下載
(175)人喜歡 2024-01-15 -
WordPress網(wǎng)站模板發(fā)帖標(biāo)題顏色設(shè)置
(131)人喜歡 2024-01-07 -
修改discuz論壇帖子標(biāo)題80字符的長度限制
(249)人喜歡 2024-01-07 -
wordpress程序調(diào)用不帶超鏈接的Tag標(biāo)簽
(234)人喜歡 2024-01-05 -
網(wǎng)站在不同時(shí)期需調(diào)整內(nèi)容更新的方向
(112)人喜歡 2023-08-12