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
Solution Add position:relative to the parent elem...
I recently came into contact with MySQL. Yesterda...
In the previous article, we wrote about how to de...
URL: http://hostname.com/contextPath/servletPath/...
Core code /*-------------------------------- Find...
Just pass in custom parameters HTML <div id=&q...
The one I wrote before is too complicated, let’s ...
<br />Before browsers can handle the next ge...
Vue routing this.route.push jump page does not re...
The installation of the rpm package is relatively...
Many people say that IE6 does not support PNG tra...
This article example shares the specific code of ...
Table of contents The dynamic particle effects ar...
ask: I have styled the hyperlink using CSS, but i...
Let's talk about the difference first last, t...