马上加入IBC程序猿 各种源码随意下,各种教程随便看! 注册 每日签到 加入编程讨论群

C#教程 ASP.NET教程 C#视频教程程序源码享受不尽 C#技术求助 ASP.NET技术求助

【源码下载】 社群合作 申请版主 程序开发 【远程协助】 每天乐一乐 每日签到 【承接外包项目】 面试-葵花宝典下载

官方一群:

官方二群:

分享一个视频的画面参数设置(进度条拖动控制)

[复制链接]
查看3097 | 回复1 | 2017-4-13 14:00:37 | 显示全部楼层 |阅读模式
[HTML] 纯文本查看 复制代码
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
    </head>
    <style>
        body{margin:0;padding:0;font-size:12px;background:#363936;}
        ul.lanren{width:245px;padding:0;margin:0;}
        .scale_panel{color:#999;width:140px;position:absolute;line-height:20px;left:0px;top:22px;}
        .scale_panel .r{float:right;}
        .scale span{ width:16px;height:16px;position:absolute;left:-2px;top:-5px;cursor:pointer;border-radius: 50%;background:#d6d6d6;}
        .scale{ background-repeat: repeat-x; background-position: 0 100%; background-color: #000; border-left: 1px #83BBD9 solid;  width: 200px; height: 8px; position: relative; font-size: 0px; border-radius: 7px;-ms-border-radius:7px;}
        .scale div{ background-repeat: repeat-x; background-color: #858585; width: 0px; position: absolute; height: 8px; left: 0; bottom: 0; }
        .lanren li{font-size:12px;line-height:50px;position:relative;height:50px;list-style:none;}
        .number{ position: absolute;right: 0px;border: 1px solid #858585;width:30px;height: 20px;line-height: 20px;text-align: center;color:#fff;top:15px;}
        p{margin:0;padding:0; color:#fff;}
        h3{ color: #fff; }
    </style>
    <body>
        <h3>色彩调节</h3>
        <p>亮度</p>
        <ul class="lanren">
            <li>
                <div class="scale_panel">
                    <div class="scale" id="bar1">
                        <div></div>
                        <span id="btn1"></span>
                    </div>
                </div>
                 <span id="title1" class="number">0</span>
            </li>
        </ul>

        <p>对比度</p>
        <ul class="lanren">
            <li>
                <div class="scale_panel">
                    <div class="scale" id="bar2">
                        <div></div>
                        <span id="btn2"></span>
                    </div>
                </div>
                 <span id="title2" class="number">0</span>
            </li>
        </ul>      
          <p>饱和度</p>
           <ul class="lanren">
            <li>
                <div class="scale_panel">
                    <div class="scale" id="bar3">
                        <div></div>
                        <span id="btn3"></span>
                    </div>
                </div>
                 <span id="title3" class="number">0</span>
            </li>
        </ul>
        <p>色调</p>
        <ul class="lanren">
            <li>
                <div class="scale_panel">
                    <div class="scale" id="bar4">
                        <div></div>
                        <span id="btn4"></span>
                    </div>
                </div>
                 <span id="title4" class="number">0</span>
            </li>
        </ul>
    </body>
    <script>
    	var scale = function (btn,bar,title){
            this.btn=document.getElementById(btn);
            this.bar=document.getElementById(bar);
            this.title=document.getElementById(title);
            this.step=this.bar.getElementsByTagName("div")[0];
            this.init();
        };
        scale.prototype={
            init:function (){
                var f=this,g=document,b=window,m=Math;
                f.btn.onmousedown=function (e){
                    var x=(e||b.event).clientX;
                    var l=this.offsetLeft;
                    var max=f.bar.offsetWidth-this.offsetWidth;
                    g.onmousemove=function (e){
                        var thisX=(e||b.event).clientX;
                        var to=m.min(max,m.max(-2,l+(thisX-x)));
                        f.btn.style.left=to+'px';
                        f.ondrag(m.round(m.max(0,to/max)*100),to);
                        b.getSelection ? b.getSelection().removeAllRanges() : g.selection.empty();
                    };
                    g.onmouseup=new Function('this.onmousemove=null');
                };
            },
            ondrag:function (pos,x){
                this.step.style.width=Math.max(0,x)+'px';
                this.title.innerHTML=pos+'%';
            }
        }
        new scale('btn1','bar1','title1');
        new scale('btn2','bar2','title2');
        new scale('btn3','bar3','title3');
        new scale('btn4','bar4','title4');
    </script>
</html>


QQ图片20170413135654.png
ibcadmin | 2017-4-14 08:55:14 | 显示全部楼层
+1+1+1
C#论坛 www.ibcibc.com IBC编程社区
C#
C#论坛
IBC编程社区
*滑块验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则