Css controls the floating code and css floating code on the right side.

Source: Internet
Author: User

Css controls the floating code and css floating code on the right side.
<! -- Place the following code on the webpage. you want to display the fixed icon position. -->
<Div id = "FloatDIV" style = "position: absolute; top: 0px; border-right: activeborder 1px solid; border-top: activeborder 1px solid; border-left: activeborder 1px solid; border-bottom: activeborder 1px solid; z-index: 9999 ">

</Div>
<Div id = "showservicepeople" class = "showservicepeople" onclick = "showservicepeople ()">
</Div>
<! -- CSS style and layout can be referenced -->
<Script type = "text/javascript">
Var MarginLeft = 130; // The distance between the floating layer and the right of the browser
Var MarginTop = 190; // The distance between the floating layer and the top of the browser
Var Width = 20; // floating layer Width
Var Heigth = 85; // floating layer height

// Set the floating layer width and height
Function Set ()
{
Document. getElementById ("FloatDIV"). style. width = Width + 'px ';
Document. getElementById ("FloatDIV"). style. height = Heigth + 'px ';
}

// Set the position of the floating layer in real time
Function Move ()
{
Var B _top = window. pageYOffset
| Document.doc umentElement. scrollTop
| Document. body. scrollTop
| 0;
Var B _width = document. body. clientWidth;
Document. getElementById ("FloatDIV"). style. top = B _top + MarginTop + 'px ';
Document. getElementById ("FloatDIV"). style. left = B _width-Width-MarginLeft + 'px ';
SetTimeout ("Move ();", 100 );
}

Function showservicepeople ()
{
Location. href = 'http://www.freeitjc.com/wp-content/uploads/2014/07/freeitapp.jpg ';
}
Set ();
Move ();

</Script>

-From http://www.freeitjc.com



CSS controls floating div Positioning

Width: 200px; height: 200px; border: 1px solid red; margin-top: 10px; margin-left: 10px; position: fixed; _ position: absolute; _ bottom: auto; _ top: expression(eval(document.doc umentElement. scrollTop ));
You can modify the height, width, and margin values by yourself.

How can a website get a QR code floating like a QR code on the Right of Baidu post? What is the code that can be scanned by a mobile phone?

Will the image be floating?
A QR code is an image.
Put the content to be displayed in the QR code, keep the QR code in the form of an image, and then perform the next step.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.