


Implementation code for DIV to scroll as the scroll bar scrolls [Recommended]_jquery
May 16, 2016 pm 03:05 PMI remember that writing this kind of code used to be troublesome, but now it’s much easier with JQuery. It only takes a few lines of code!
<script type="text/javascript" src="Js/jquery-1.7.2.min.js"></script> <script type="text/javascript"> $(function() { $(window).scroll(function() { var top = $(window).scrollTop()+200; var left= $(window).scrollLeft()+320; $("#editInfo").css({ left:left + "px", top: top + "px" }); }); }); </script> <div id="editInfo" style="float:left;width:300px;background-color:#ccc;position:absolute;top:200px;"> <div>用户名:<input type="text" /></div> <div>密码:<input type="text" /></div> <div>年龄:<input type="text" /></div> <div>备注:<input type="text" /></div> <div><input type="button" value="保存" /></div> </div>
The above implementation code for DIV to scroll as the scroll bar scrolls [recommended] is all the content shared by the editor. I hope it can give you a reference, and I hope you will support Script Home.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Microsoft brings Windows 11's Fluent scrollbars to Google Chrome

How to hide scroll bar scrolling in react

How to implement scrolling to a specified element position in JavaScript?

HTML, CSS, and jQuery: Make an auto-scrolling bulletin board

How to set the scroll bar to always show on Mac system - How to set the scroll bar to always show

How to use css to realize that a div is missing a corner

Implementation of word-marking translation browser script based on ChatGPT API
