In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to achieve the function of imitating CSDN Blog to return to the top of the page. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Only two changes have been made:
The speed of return-- > changed to go back slowly. (it turned out to be a flash of return)
To return to the time when the top icon appears-> changed to display as long as it is not at the top. (originally displayed only after scrolling down the 500px)
Note: JS must be written after Html
HTML
The code is as follows:
Javascript code
The code is as follows:
$(function () {)
Var dumbtopping $('# dmurtopo')
_ document.onscroll=function () {
Var scrTop= (document.body.scrollTop | | document.documentElement.scrollTop)
If (scrTop > 500) {
If (scrTop > 0) {
D_top.show ()
} else {
D_top.hide ()
}
}
$('# dmurtopmura') .click (function () {
$("html,body") .animate ({scrollTop: 0} 500)
/ / scrollTo (0re0)
This.blur ()
Return false
});
});
CSS style
The code is as follows:
# d-top {
Position: fixed
Float: right
Z-index: 10
Right: 10px
Bottom: 40px
}
# d-top img {
Width: 42px
Opacity: 0.3
}
Img {
Border: medium none
}
On "how to achieve imitation of CSDN Blog back to the top of the page" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.