zoukankan      html  css  js  c++  java
  • jQuery拖动进度条

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="http://www.w3school.com.cn/jquery/jquery.js"></script>
    <script type="text/javascript">
    	$(document).ready( function() {
    	$('.taskBox').delegate('.taskBoxLinks','mousemove',function(e){		
    		var $mouse = e.pageX - $(this).offset().left;
    		var $span = Math.round($mouse/22.5)*10;		
    		$(this).find('h4').stop().animate({$span+'%'},50);		
    		$(this).next('span').text($span+'%');
    	}).delegate('.taskBoxLinks','mouseleave',function(){
    		$(this).find('h4').stop().animate({'10%'},50);
    		var $mousex = $(this).find('h3').width();
    		var $spanx = Math.round($mousex/22.5)*10;
    		if($spanx==100){
    			$(this).next('span').text('进度完成')	
    		}else{
    			$(this).next('span').text($spanx+'%');
    		}	
    	}).delegate('.taskBoxLinks','click',function(e){
    		var $mouse = e.pageX - $(this).offset().left;
    		var $span = Math.round($mouse/22.5)*10;
    		$(this).find('h3').stop().animate({$span+'%'},100);
    		if($span==100){
    			$(this).next('span').text('进度完成')	
    		}			
    	});		
    });
    </script>
    <title>进度条</title>
    <style type="text/css">
    body,td,th {
    	font-family: Verdana, Geneva, sans-serif;
    	font-size: 12px;
    }
    h1{ font-size:16px; color:#999; font-weight:normal; text-align:center; line-height:90px; border-top:1px dashed #ddd; margin-top:50px;}
    *{ margin:0; padding:0;}
    .taskBoxLinks { float:left; 225px; height:7px; font-size:0; line-height:0; background:#f2f2f2; border:1px solid #dedede;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px; position:relative; margin-top:8px; margin-right:10px; cursor:pointer;}
    .taskBoxLinks h3,.taskBoxLinks h4{ position:absolute; left:-1px; top:-1px; height:7px; font-size:0; line-height:0; 10%; background:#a3d9f4; border:1px solid #187aab; -moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px; z-index:99;}
    .taskBoxLinks h4 { border:1px solid #91cdea; background:#f5fafc; z-index:88;}
    .taskBox { 360px; margin:40px auto; color:#666;}
    </style>
    </head>
    <body>
    	<div class="taskBox">		
    		<div class="taskBoxLinks"><h3 style="10%;"></h3><h4></h4></div>进度<span>10%</span>
    	</div>
        <div class="taskBox" style="padding-left:100px;">		
    		<div class="taskBoxLinks"><h3 style="60%;"></h3><h4></h4></div>进度<span>60%</span>
    	</div>
        <div class="taskBox">		
    		<div class="taskBoxLinks"><h3 style="20%;"></h3><h4></h4></div>进度<span>20%</span>
    	</div>
        <h1>by <a href="http://www.wweya.com">www.wweya.com</a></h1>
    </body>
    </html>

  • 相关阅读:
    指定一个M3U8文件,判断它包含的TS文件是不是都存在。指定一个Office生成的Swf文件,判断它包含的Swf文件是不是完整都存在。
    东师理想云平台异步任务处理系统V2.0重构思路
    Mysql查询出所有列名
    IntelliJ IDEA添加jar包
    IDEA下利用Jrebel插件实现JFinal项目main方法【热加载】
    整理OpenResty+Mysql+Tomcat+JFinal+Cannal+HUI
    有没有 linux 命令可以获取我的公网 ip, 类似 ip138.com 上获取的 ip?
    MongoDB学习笔记(5)--document
    MongoDB学习笔记(4)--collection
    MongoDB学习笔记(3)--删除数据库
  • 原文地址:https://www.cnblogs.com/zhangqs008/p/2802198.html
Copyright © 2011-2022 走看看