1.html part Copy code The code is as follows:<!DOCTYPE html> <html> <head> <title>blog_floatdiv.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">--> <link rel="stylesheet" type="text/css" href="./css/blog_floatdiv.css"> <script type="text/javascript" src="./js/jquery-1.9.1.js"></script> <script type="text/javascript" src="./js/blog_floatdiv.js"></script> </head> <body> <div id="fdiv"> I am a floating div <img src="images/logingb.png"> </div> Floating divs floating div floating div floating div floating div floating div floating div floating div floating div Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs floating div floating div floating div floating div floating div floating div floating div floating div floating div Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs Floating divs </body> </html> 2.css part Copy code The code is as follows:#fdiv{ width:200px; height: 500px; background: yellow; position: fixed; top: 128px; _position: absolute; _top: expression(eval(document.documentElement.scrollTop)); } #fdiv img{ margin-left: 190px; margin-top: 470px; } 3.js part Copy code The code is as follows:$(function() { $("#fdiv img").click(function(){ $("#fdiv").hide(); }); }); |
<<: An article tells you how to write a Vue plugin
>>: CSS Back to Top Code Example
JS provides three methods for intercepting string...
Table of contents 1. Solution 1 (UDF) Demo Case 2...
Table of contents 1. Map method 2. Application ba...
Without further ado, I will post the code for you...
1. Add a comment block at the beginning of the sty...
This article uses examples to illustrate the usag...
Recently, when I was doing a practice project, I ...
Recently, when I was working on a project, I was ...
Overview It is usually not what we want to presen...
Install virtualization software Before installing...
Preface The default database file of the MySQL da...
ffmpeg is a very powerful audio and video process...
Pre-installation preparation The main purpose of ...
Table of contents 1. TypeScript is introduced int...
Table of contents 1. Sorting function 2. Prepare ...