CSS3 및 jquery로 구현된 그라데이션 동적 진행률 표시줄
진행률 표시줄은 일반적인 유형의 웹사이트입니다. 오늘은 외국 웹사이트의 예를 연구한 후 CSS3를 사용하여 진행률 표시줄을 구현해 보았습니다.
html 코드는 다음과 같습니다. 다음과 같습니다:
<div class="progress-bar blue stripes"> <span style="width: 40%"></span> </div> <p>Set above to: <a href="http://www.php1.cn/"> <a href="http://www.php1.cn/"> <a href="http://www.php1.cn/"> <a href="http://www.php1.cn/"> </p> <div class="progress-bar orange shine"> <span style="width: 65%"></span> </div> <p>Set above to: <a href="http://www.php1.cn/"> <a href="http://www.php1.cn/"> <a href="http://www.php1.cn/"> <a href="http://www.php1.cn/"> </p> <div class="progress-bar green glow"> <span style="width: 55%"></span> </div> <p>Set above to: <a href="http://www.php1.cn/"> <a href="http://www.php1.cn/"> <a href="http://www.php1.cn/"> <a href="http://www.php1.cn/"> </p>
css 스타일:
body{ background:#222; width:360px; margin:0 auto; font:13px 'trebuchet MS',Arial,Helvetica;} h2, p {text-align: center;color: #fafafa;text-shadow: 0 1px 0 #111; } a {color: #777;} .progress-bar{ background-color:#1a1a1a; height:25px; padding:5px; width:350px; margin:70px 0 20px 0;-moz-border-radius:5px; -webkit-border-raidus:5px; border-radius:5px;-moz-box-shadow:0 1px 5px #000 inset, 0 1px 0 #444;-webkit-box-shadow:0 1px 5px #1a1a1a inset,0 1px 0 #444; box-shadow:0 1px 5px inset,0 1px 0 #444; } .progress-bar span{ display:inline-block; height:100%; background-color:#777; -moz-border-radius:3px;-webkit-border-radius:3px; border-radius:3px; border-radius:3px; box-shadow:0 1px 0 rgba(255,255,255,.5) inset; -webkit-box-shadow:0 1px 0 rgba(255,255,.5) inset; -moz-box-shadow:0 1px 0 rgba(255,255,.5) inset; -webkit-transition:width .4s ease-in-out; -moz-transition:width .4s ease-in-out;-ms-transition:width .4s ease-in-out;transition: width .4s ease-in-out; }
주로 진행률 표시줄의 배경을 구현합니다:
.blue span { background-color: #34c2e3; } .orange span{ background-color:#fecf23; background-image:-webkit-gradient(linear,left top,left bottom,from(#fecf23), to(#fd9215)); background-image:-webkit-linear-gradient(top,#fecf23, #fd9215); background-image:-moz-linear-gradient(top,#fecf23, #fd9215); background-image:-ms-linear-gradient(top, #fecf23, #fd9215); background-image:-o-linear-gradient(top, #fecf23, #fd9215); background-image: linear-gradient(top, #fecf23, #fd9215); filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#fecf23', endColorstr='#fd9215'); /* IE6 & IE7 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#fecf23', endColorstr='#fd9215')"; /* IE8 */ } .green span{ background-color:#a5df41; background-image:-webkit-gradient(linear,left top,left bottom,from(#a5df41), to(#4ca916)); background-image:-webkit-linear-gradient(top,#a5df41, #4ca916); background-image:-moz-linear-gradient(top,#a5df41, #4ca916); background-image: -ms-linear-gradient(top, #a5df41, #4ca916); background-image: -o-linear-gradient(top, #a5df41, #4ca916); background-image: linear-gradient(top, #a5df41, #4ca916); filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#a5df41', endColorstr='#4ca916'); /* IE6 & IE7 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#a5df41', endColorstr='#4ca916')"; /* IE8 */ } .stripes span { -webkit-background-size: 30px 30px; -moz-background-size: 30px 30px; background-size: 30px 30px; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(.25, rgba(255, 255, 255, .15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .15)), color-stop(.75, rgba(255, 255, 255, .15)), color-stop(.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -ms-linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -webkit-animation: animate-stripes 3s linear infinite; -moz-animation: animate-stripes 3s linear infinite; } @-webkit-keyframes animate-stripes { 0% {background-position: 0 0;} 100% {background-position: 60px 0;} } @-moz-keyframes animate-stripes { 0% {background-position: 0 0;} 100% {background-position: 60px 0;} } .shine span { position: relative; } .shine span::after { content: ''; opacity: 0; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #fff; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; -webkit-animation: animate-shine 2s ease-out infinite; -moz-animation: animate-shine 2s ease-out infinite; } @-webkit-keyframes animate-shine { 0% {opacity: 0; width: 0;} 50% {opacity: .5;} 100% {opacity: 0; width: 95%;} } @-moz-keyframes animate-shine { 0% {opacity: 0; width: 0;} 50% {opacity: .5;} 100% {opacity: 0; width: 95%;} } /*---------------------------*/ .glow span { -moz-box-shadow: 0 5px 5px rgba(255, 255, 255, .7) inset, 0 -5px 5px rgba(255, 255, 255, .7) inset; -webkit-box-shadow: 0 5px 5px rgba(255, 255, 255, .7) inset, 0 -5px 5px rgba(255, 255, 255, .7) inset; box-shadow: 0 5px 5px rgba(255, 255, 255, .7) inset, 0 -5px 5px rgba(255, 255, 255, .7) inset; -webkit-animation: animate-glow 1s ease-out infinite; -moz-animation: animate-glow 1s ease-out infinite; } @-webkit-keyframes animate-glow { 0% { -webkit-box-shadow: 0 5px 5px rgba(255, 255, 255, .7) inset, 0 -5px 5px rgba(255, 255, 255, .7) inset;} 50% { -webkit-box-shadow: 0 5px 5px rgba(255, 255, 255, .3) inset, 0 -5px 5px rgba(255, 255, 255, .3) inset;} 100% { -webkit-box-shadow: 0 5px 5px rgba(255, 255, 255, .7) inset, 0 -5px 5px rgba(255, 255, 255, .7) inset;} } @-moz-keyframes animate-glow { 0% { -moz-box-shadow: 0 5px 5px rgba(255, 255, 255, .7) inset, 0 -5px 5px rgba(255, 255, 255, .7) inset;} 50% { -moz-box-shadow: 0 5px 5px rgba(255, 255, 255, .3) inset, 0 -5px 5px rgba(255, 255, 255, .3) inset;} 100% { -moz-box-shadow: 0 5px 5px rgba(255, 255, 255, .7) inset, 0 -5px 5px rgba(255, 255, 255, .7) inset;} }
jquey 부분:
$(document).ready(function(){ $('.quarter').click(function(){ $(this).parent().prev().children("span").css('width','25%'); }); $('.half').click(function(){ $(this).parent().prev().children('span').css("width",'50%'); }); $('.three-quarters').click(function(){ $(this).parent().prev().children('span').css('width','75%'); }); $('.full').click(function(){ $(this).parent().prev().children('span').css('width','100%'); }) })

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











Svelte Transition API는 맞춤형 전환을 포함하여 문서를 입력하거나 떠날 때 구성 요소를 애니메이션하는 방법을 제공합니다.

최근 Bitcoin의 가격이 20k 달러가 넘는 USD가 최근에 등반되면서 최근 30k를 끊었으므로 Ethereum을 만드는 데 깊이 다이빙을 할 가치가 있다고 생각했습니다.

웹 사이트의 컨텐츠 프레젠테이션을 설계하는 데 얼마나 많은 시간을 소비합니까? 새 블로그 게시물을 작성하거나 새 페이지를 만들 때

이 기사에서는 그림자 및 그라디언트와 같은 텍스트 효과에 CSS를 사용하여 성능을 최적화하고 사용자 경험을 향상시킵니다. 초보자를위한 리소스도 나열됩니다. (159 자)

개발자로서 어느 단계에 있든, 우리가 완료 한 작업은 크든 작든, 개인적이고 전문적인 성장에 큰 영향을 미칩니다.

NPM 명령은 서버 시작 또는 컴파일 코드와 같은 것들에 대한 일회성 또는 지속적으로 실행되는 프로세스로 다양한 작업을 실행합니다.
