CSS Circles and page slide effects (June 02, 2015)

Source: Internet
Author: User

Background: Because see a lot of page some effect, click on the Red Box section, then the page slide to another location, view the source code of the page found the red box part of the CSS with rounded corners of the border to achieve, so ...

On the Code

<! DOCTYPE html>
<meta charset= "UTF-8" >
<title></title>
<link rel= "stylesheet" href= "Css/bootstrap.min.css" type= "Text/css"/>
<style>
body{
margin:0px;
padding:0px;
Background-color: #1f272a;
}
/* Fillet effect Implementation */
. btn-dwn {
/*
Required Fields
*/

/* Width and height must be the same to be guaranteed to be round */
width:58px;
height:58px;
The larger the property value of the/*border-radius, the more pronounced the round effect is.
border-radius:50%;
/* Set border size, style, color */
border:2px solid Rgba (255,255,255,.15);

/*
No Required fields
*/
Color:rgba (255,255,255,.6);
Text-align:center;
font-size:18px;
Position:absolute;
left:50%;
bottom:60px;
line-height:58px;
}
</style>
<script>
Slide effect
function Scrolltotarget (D) {
if (D = = 1)//Top of page
{
D = 0;
}
else if (D = = 2)//Bottom of page
{
D = $ (document). Height ();
}
else//Specific Bloc
{
D = $ (d). Offset (). Top;
}

$ (' html,body '). Animate ({scrolltop:d}, ' slow ');
}
</script>
<body>

<a onclick= "Scrolltotarget (' #core ')" class= "Btn-dwn" ><span class= "Glyphicon glyphicon-chevron-down" > </span></a>

</body>

Achieve results

About Sliding

Using the jquery animation effect, script script in the Scrolltotarget method can be implemented sliding, copy page source code, it is necessary to note that in the page also need to have an id "core" element, click the button will be sliding to the corresponding location

CSS Circles and page slide effects (June 02, 2015)

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.