Home >Web Front-end >JS Tutorial >Example code for div to be fixed at the top when scrolling to the top of the page_javascript skills

Example code for div to be fixed at the top when scrolling to the top of the page_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:33:151272browse

This example uses Javascript to fix the DIV at the top when it reaches the top when scrolling the page. The effect is a bit flashy under IE, the effect URL: http://www.keleyi.com/keleyi/phtml/fixdiv.htm

The following is the code:

Copy code The code is as follows:








Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn