精华内容
下载资源
问答
  • Web slider problem

    2020-11-26 10:09:19
    <p><img alt="web-slider" src="https://img-blog.csdnimg.cn/img_convert/b69052429bbf887ab849b4f9a93db883.png" /></p> <h3>System information <ul><li><strong>Operating system</strong>: elementary OS</li>...
  • !... <head> <title></title>...margin:0} ul{list-style:none} .slider-...margin:100px auto} .slider-focus .slider{width:3500px; position:absolute; left:0px; top:0px; height:240px} .slider-f
  • Javascript Web Slider 焦点图 教程源码

    千次阅读 2013-10-10 13:07:52
    HTML代码: html> head>  title>title> style> *{padding:0;margin:0} ....slider-focus{width:670px;height:240px;overflow:hidden;position:relative;margin:100px auto}

    HTML代码:

    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
    <style>
    *{padding:0;margin:0}
    ul{list-style:none}
    .slider-focus{width:670px;height:240px;overflow:hidden;position:relative;margin:100px auto}
    .slider-focus .slider{width:3500px; position:absolute; left:0px; top:0px; height:240px}
    .slider-focus .slider li{float:left;}
    .slider-focus .btns{position: absolute; right: 0px; bottom: 5px}
    .slider-focus .btns li{width:18px;height:18px;  float:left; background:#fff; margin-right:5px; cursor:pointer}
    .slider-focus .btns li.cur{background:#f60}
    </style>
    </head>
    <body>
        <div class="slider-focus">
            <ul class="slider">
                            <li><img src="http://img11.360buyimg.com/da/g13/M05/0D/0A/rBEhUlJCfiYIAAAAAADqWhDpUVsAADfqgDwmw4AAOpy960.jpg"></li>
                            <li><img src="http://img11.360buyimg.com/da/g14/M07/11/15/rBEhVVI_5zMIAAAAAADDgfSaKlQAADc8AFf20cAAMOZ670.jpg"></li>
                            <li><img src="http://img11.360buyimg.com/da/g13/M03/0D/13/rBEhVFJD_HcIAAAAAADsfenKOe0AADjVwPmryQAAOyV341.jpg"></li>
                            <li><img src="http://img14.360buyimg.com/da/g15/M00/0C/0E/rBEhWlJEHcwIAAAAAAEFI3XGv_YAADj-wC9W60AAQU7805.jpg"></li>
            </ul>
            <ul class="btns">
                <li class="cur"></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </ul>
        </div>
    <script src="jquery-1.9.1.js"></script>
    <script src="slider.js"></script>
    </body>
    </html>
    Javasscript 代码:
    function Sliderfocus(options){
        this.focus = options.focus;
        this.slider = options.slider;
        this.btns = options.btns;
        this.width = options.width;
        this.speed = options.speed || 800;
        this.curIndex = options.curIndex || 0;
        this.size = this.btns.size();
        this.init();
        this.timeout = null;
        this.stopTemp = 1 ;
    }
     
    Sliderfocus.prototype = {
        init:function(){
          this.auto();
          this.bind();
        },
        play:function(){
            this.slider.stop().animate({
                left:-this.curIndex * this.width
            },this.speed);
        },
        auto:function(){
            var that = this;
            this.timeout = setTimeout(function(){
                if(that.stopTemp == 0){
                    return;
                }else{
                    that.next();
                    that.auto();
                }
            },4000);
        },
        prev:function(){
            this.curIndex = --this.curIndex<0? this.size-1 : this.curIndex;
            this.play();
        },
        next:function(){
            this.curIndex = ++this.curIndex>this.size-1? 0 : this.curIndex;
            console.log(this.curIndex)
            this.play();
        },
        stop:function(){
            this.stopTemp = 0;
        },
        bind:function(){
            var that = this;
            this.focus.bind("mouseover",function(){
                that.stop();
            }).bind("mouseout",function(){
                    that.stopTemp = 1;
                    //that.auto();
                });
            this.letsgo();
        },
        letsgo:function(){
            var that = this;
            this.btns.bind("click",function(){
                var index = $(this).index();
                that.curIndex = index;
                that.play();
     
            });
        }
    };
     
    new Sliderfocus({
        focus:$(".slider-focus"),
        slider:$(".slider-focus .slider"),
        btns:$(".btns li"),
        width:670
    });


    展开全文
  • 两种方式实现web html slider

    千次阅读 2014-04-25 17:26:03
    最近做一个项目,要实现web页面上要实现slider

    最近做一个项目,web页面上要实现slider,经过调研,先后采用了两种方式:

    1.用html type = “range”的方式

    实现很简单,

    <input type="range" min="10" max="300" value="100" step="10" οnchange="showValue(this.value)" style="">


    这样就行了,在页面上接收滑动块的值,只需要在代码里这样做:

    function showValue(newValue){
               //to do:接收newValue的值
    }


    很简单,但是有个缺点就是该滑动条在IE浏览器下不兼容,显示是个输入框,而在chrome,firefox,safari下都是好的。

    为了兼容IE,采用了另外一套方法,采用了Jquery的UI库。

     

    2.JQuery UI实现

    该方法可以参考:

    http://api.jqueryui.com/slider/#entry-examples

    主流浏览器是都支持了,但是要支持移动端上的touch support,还得参考:

    http://touchpunch.furf.com/

    下面给出具体实现:

    <link href="themes/default/css/jquery-ui.css" rel="stylesheet" type="text/css"/>
    <script src="./publics/js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="./publics/js/jquery-ui.min.js"></script>
    <script src="./publics/js/jquery.ui.touch-punch.min.js"></script>


    以上相关js和css是必须的。接下来就很简单了。

    <div  id="slider">

    然后在代码里:

    $("#slider").slider({
                    slide: function( event, ui ) {
                    // ui.value is 0-100
                                        }
     });


    slide:表示滑动事件。更多事件和用法请参考官方文档,链接上面已经给出。

     

    展开全文
  • <div><p>Hello, just wanted to ask if its easy or not to insert Brightness slider into ws2812fx_segments_web ? Need to insert few lines of code or its more complicated?? Maybe someone has already done ...
  • <div><p>This sets the background color of the sliders in the extension to <code>#a0a0a0</code> when unchecked. The aim is to make it clear whether or not the option is enabled. <p>Let me know if there...
  • <div><p>This commit implements slider widget in Classic UI. <p>Changes overview: - <code>slider.html</code>: the snippet was modified and now contains slider elements along with the initialization ...
  • <div><p>Fixes issue https://github.com/domoticz/domoticz/issues/513</p><p>该提问来源于开源项目:domoticz/domoticz</p></div>
  • <div><p>I just realised that the new player is missing a volume slide. I can imagine that people (e. g. my mother) don't know how to change the system'...podlove/podlove-web-player</p></div>
  • 文章目录1、前言2、操作原理3.代码 授人以鱼不如授人以渔,目的不是为了教会你具体项目开发,而是学会学习的能力。...这个 ESP8266(NodeMcu) Web Server会在手机上访问浏览器,并且是局域网有效 2

    授人以鱼不如授人以渔,目的不是为了教会你具体项目开发,而是学会学习的能力。希望大家分享给你周边需要的朋友或者同学,说不定大神成长之路有博哥的奠基石。。。

    快速导航
    单片机菜鸟的博客快速索引(快速找到你要的)

    重点说一下,麻烦三连点赞,你的点赞是博主创作的前进动力

    1、前言

    建立一个独立的 ESP8266 Web Server 去控制LED亮度(PWM)。

    这个 ESP8266(NodeMcu) Web Server会在手机上访问浏览器,并且是局域网有效

    在这里插入图片描述
    在这里插入图片描述

    2、操作原理

    • ESP8266建立Web Server,显示一个Slider Web页面,Slider也就是滑动器
    • 当你移动Slider,就会发送一个HTTP请求到ESP8266,带上Slider的值
    • 这个HTTP请求的格式是:GET/slider?value=SLIDERVALUE,SLIDERVALUE是一个0-1023的整数
    • ESP8266收到这个请求后,调整PWM占空比,占空比影响着LED亮度

    3.代码

    // Import required libraries
    #include <ESP8266WiFi.h>
    #include <ESPAsyncTCP.h>
    #include <ESPAsyncWebServer.h>
    
    // 替换wifi账号和密码
    const char* ssid = "REPLACE_WITH_YOUR_SSID";
    const char* password = "REPLACE_WITH_YOUR_PASSWORD";
    
    const int output = 2;
    
    String sliderValue = "0";
    
    const char* PARAM_INPUT = "value";
    
    // Create AsyncWebServer object on port 80
    AsyncWebServer server(80);
    
    const char index_html[] PROGMEM = R"rawliteral(
    <!DOCTYPE HTML><html>
    <head>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>ESP Web Server</title>
      <style>
        html {font-family: Arial; display: inline-block; text-align: center;}
        h2 {font-size: 2.3rem;}
        p {font-size: 1.9rem;}
        body {max-width: 400px; margin:0px auto; padding-bottom: 25px;}
        .slider { -webkit-appearance: none; margin: 14px; width: 360px; height: 25px; background: #FFD65C;
          outline: none; -webkit-transition: .2s; transition: opacity .2s;}
        .slider::-webkit-slider-thumb {-webkit-appearance: none; appearance: none; width: 35px; height: 35px; background: #003249; cursor: pointer;}
        .slider::-moz-range-thumb { width: 35px; height: 35px; background: #003249; cursor: pointer; } 
      </style>
    </head>
    <body>
      <h2>ESP Web Server</h2>
      <p><span id="textSliderValue">%SLIDERVALUE%</span></p>
      <p><input type="range" onchange="updateSliderPWM(this)" id="pwmSlider" min="0" max="1023" value="%SLIDERVALUE%" step="1" class="slider"></p>
    <script>
    function updateSliderPWM(element) {
      var sliderValue = document.getElementById("pwmSlider").value;
      document.getElementById("textSliderValue").innerHTML = sliderValue;
      console.log(sliderValue);
      var xhr = new XMLHttpRequest();
      xhr.open("GET", "/slider?value="+sliderValue, true);
      xhr.send();
    }
    </script>
    </body>
    </html>
    )rawliteral";
    
    // Replaces placeholder with button section in your web page
    String processor(const String& var){
      //Serial.println(var);
      if (var == "SLIDERVALUE"){
        return sliderValue;
      }
      return String();
    }
    
    void setup(){
      // Serial port for debugging purposes
      Serial.begin(115200);
    
      analogWrite(output, sliderValue.toInt());
    
      // Connect to Wi-Fi
      WiFi.begin(ssid, password);
      while (WiFi.status() != WL_CONNECTED) {
        delay(1000);
        Serial.println("Connecting to WiFi..");
      }
    
      // Print ESP Local IP Address
      Serial.println(WiFi.localIP());
    
      // Route for root / web page
      server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
        request->send_P(200, "text/html", index_html, processor);
      });
    
      // Send a GET request to <ESP_IP>/slider?value=<inputMessage>
      server.on("/slider", HTTP_GET, [] (AsyncWebServerRequest *request) {
        String inputMessage;
        // GET input1 value on <ESP_IP>/slider?value=<inputMessage>
        if (request->hasParam(PARAM_INPUT)) {
          inputMessage = request->getParam(PARAM_INPUT)->value();
          sliderValue = inputMessage;
          analogWrite(output, sliderValue.toInt());
        }
        else {
          inputMessage = "No message sent";
        }
        Serial.println(inputMessage);
        request->send(200, "text/plain", "OK");
      });
      
      // Start server
      server.begin();
    }
      
    void loop() {
      
    }
    

    这里需要另外装两个库

    • ESPAsyncTCP
    • ESPAsyncWebServer

    Async也就是异步的意思。。。。去到Github下载,然后解压放到Arduino 的lib上

    在这里插入图片描述

    在这里插入图片描述
    在这里插入图片描述

    参考文章:

    展开全文
  • $('#full-width-slider').royalSlider({ arrowsNav: true, loop: false, keyboardNavEnabled: true, controlsInside: false, imageScaleMode: 'fill', arrowsNavAutoHide: false, autoScaleSlider: true, ...
  • <div><p>This PR reverts #2792 which originally added a slider to Class-UI. <p>I reverted the change for several reasons: - there was a serious issue with the slider which renders the Classic-UI under ...
  • <p>I had an issue on web at work. We ended up not using a different approach but I spotted the difference between web and mobile behaviour and how to fix it before we did. <h2>Test Plan: <p>I used the...
  • <div><p>This idea has been proposed in #130 long time ago. And popper.js has been included in our repo for a long time. <p>Now, I have made it true! <p>In this PR, I also updated popper.min.js to v2.0...
  • you move the time slider brush outside of the plotted data range - at this stage all interactive controls stop working and need to hit page refresh. It happens in both Chrome and Safari. Haven't ...
  • React Swift Slider是用于React的简单图像/图片滑块。 演示版 关于如何使用react-swift-slider示例回购 安装 npm i react-swift-slider 用法 import SwiftSlider from 'react-swift-slider' const data = [ { 'id...
  • <div><p>Added a volume slider in the webinterface and changed interface.py accordingly. <p>This does not have any CSS styling yet, do you have any design guidelines? <p>There might also be performance...
  • However, it would be better to use a slider option… where we just drag the mouse or fingers sideways… <p>Thanks! ErnestPH</p><p>该提问来源于开源项目:AzuraCast/AzuraCast</p></div>
  • Slider discrete

    2020-12-27 07:17:14
    <p>https://github.com/material-components/material-components-web/tree/master/packages/mdc-slider#discrete-slider</p>该提问来源于开源项目:prateekbh/preact-material-components</p></div>
  • Slider input

    2020-12-25 22:21:26
    <div><h2>Done <p>Widened the input in sliders to allow for up to 4 digits <h2>QA <ul><li>Pull code</li><li>Run <code>./run serve --watch</code></li>...canonical-web-and-design/vanilla-framework</p></div>
  • But I just see a slider. <p><img alt="Screen Shot 2019-06-03 at 5 53 59 PM" src="https://user-images.githubusercontent.com/3178344/58843715-9948a700-8628-11e9-896f-6149504d7774.png" /></p><p>该提问...
  • slider幻灯片(焦点图轮换) 网站常用效果之一,以下为简化版,用于学习javascript基础知识。 效果图: slider幻灯片(焦点图轮换)- 纯JS简化版 <html> <head> <meta ...

    slider幻灯片(焦点图轮换)

     

    网站常用效果之一,以下为简化版,用于学习javascript基础知识。

    效果图:

    slider幻灯片(焦点图轮换) - 纯JS简化版

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>slider幻灯片 - 纯JS简化版</title>
    <style type="text/css">
    *{margin: 0; padding: 0;}
    /* slider */
    #sliderbox { width: 500; height:313px;position: relative; overflow: hidden;margin: 20px;}
    #slider {list-style: none; margin: 0; padding: 0;}
    #slider li {float:left; margin: 0; padding: 0;}
    #slidertab {position: absolute; right: 10px; bottom:10px; width: 80px; height: 20px; list-style: none;}
    #slidertab li {float: left; width: 20px; height: 20px; margin: 2px; background: #eee;text-align: center; line-height: 20px;font-size: 12px;}
    #slidertab li.sliderclass {background: #f00;}
    </style>
    <script type="text/javascript">
    
    window.onload = function() {
    
    	var sliderbox = document.getElementById('sliderbox');
    	var slider = document.getElementById('slider');
    	var sliderli = slider.getElementsByTagName('li');
    	var slidertab = document.getElementById('slidertab');
    	var slidertabli = slidertab.getElementsByTagName('li');
    
    	var inow = 0;
    
    	sliderbox.onmouseover = function() {
    		clearInterval(timer);
    	}
    
    	sliderbox.onmouseout =function() {
    		//clearInterval(timer);
    		timer = setInterval(autoplay, 1000);
    	}
    
    	for(var i=0; i<slidertabli.length; i++) {
    		slidertabli[i].index = i;
    		slidertabli[i].onclick = function() {
    			clearInterval(timer);
    			for(var a=0; a<slidertabli.length; a++) {
    				slidertabli[a].className = "";
    				sliderli[a].style.display = "none";
    			}
    			this.className = "sliderclass";
    			sliderli[this.index].style.display = "block";
    			inow = this.index;
    		}
    	}
    
    	function autoplay() {
    		for(var i=0; i<sliderli.length; i++) {
    			sliderli[i].style.display = 'none';
    			slidertabli[i].className = "";
    		}
    		sliderli[inow].style.display = 'block';
    		slidertabli[inow].className = "sliderclass";
    		inow = inow==sliderli.length-1 ? 0 : inow+1;
    	}
    
    	timer = setInterval(autoplay, 1000);
    }
    
    </script>
    </head>
    <body>
    
    <div id="sliderbox">
    	<ul id="slider">
    		<li><img src="tab1.jpg" /></li>
    		<li><img src="tab2.jpg" /></li>
    		<li><img src="tab3.jpg" /></li>
    	</ul>
    	<ul id="slidertab">
    		<li>1</li>
    		<li>2</li>
    		<li>3</li>
    	</ul>
    </div>
    
    </body>
    </html>
    

     

    slider幻灯片 - 面向对象版

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>slider幻灯片 - 面向对象版</title>
    <style type="text/css">
    *{margin: 0; padding: 0;}
    /* slider */
    #sliderbox, #sliderbox2 { width: 500; height:313px;position: relative; overflow: hidden;margin: 20px;}
    #slider, #slider2 {list-style: none; margin: 0; padding: 0;}
    #slider li, #slider2 li {float:left; margin: 0; padding: 0;}
    #slidertab, #slidertab2 {position: absolute; right: 10px; bottom:10px; width: 80px; height: 20px; list-style: none;}
    #slidertab li, #slidertab2 li {float: left; width: 20px; height: 20px; margin: 2px; background: #eee;text-align: center; line-height: 20px;font-size: 12px;}
    #slidertab li.sliderclass, #slidertab2 li.sliderclass {background: #f00;}
    </style>
    <script type="text/javascript">
    window.onload = function() {
    	new slider('sliderbox', 'slider', 'slidertab');
    	new slider('sliderbox2', 'slider2', 'slidertab2');
    }
    
    function slider(sliderbox, slider, slidertab) {
    
    	var _this = this;
    	var sliderbox = document.getElementById(sliderbox);
    	var slider = document.getElementById(slider);
    	var slidertab = document.getElementById(slidertab);
    	
    	this.sliderli = slider.getElementsByTagName('li');
    	this.slidertabli = slidertab.getElementsByTagName('li');
    	this.inow = 0;
    
    	sliderbox.onmouseover = function() {
    		_this.stop(_this);
    	}
    
    	sliderbox.onmouseout = function() {
    		_this.autoplay(_this);
    	}
    
    	for(var i=0; i<this.slidertabli.length; i++) {
    		this.slidertabli[i].index = i;
    		this.slidertabli[i].onclick = function() {
    			_this.tabfn(_this, this);
    		}
    	}
    
    	_this.autoplay(this);
    
    };
    
    slider.prototype.autoplay = function(obj) {
    	obj.timer = setInterval(function(){
    		for(var i=0; i<obj.sliderli.length; i++) {
    			obj.sliderli[i].style.display = 'none';
    			obj.slidertabli[i].className = "";
    		}
    		obj.sliderli[obj.inow].style.display = 'block';
    		obj.slidertabli[obj.inow].className = "sliderclass";
    		obj.inow = obj.inow==obj.sliderli.length-1 ? 0 : obj.inow+1;
    	}, 1000);
    }
    
    slider.prototype.stop = function(obj) {
    	clearInterval(obj.timer);
    }
    
    slider.prototype.tabfn = function(obj, elem) {
    			clearInterval(obj.timer);
    			for(var a=0; a<obj.slidertabli.length; a++) {
    				obj.slidertabli[a].className = "";
    				obj.sliderli[a].style.display = "none";
    			}
    			elem.className = "sliderclass";
    			obj.sliderli[elem.index].style.display = "block";
    			obj.inow = elem.index;
    }
    
    </script>
    </head>
    <body>
    
    <div id="sliderbox">
    	<ul id="slider">
    		<li><img src="tab1.jpg" /></li>
    		<li><img src="tab2.jpg" /></li>
    		<li><img src="tab3.jpg" /></li>
    	</ul>
    	<ul id="slidertab">
    		<li>1</li>
    		<li>2</li>
    		<li>3</li>
    	</ul>
    </div>
    
    <div id="sliderbox2">
    	<ul id="slider2">
    		<li><img src="tab1.jpg" /></li>
    		<li><img src="tab2.jpg" /></li>
    		<li><img src="tab3.jpg" /></li>
    	</ul>
    	<ul id="slidertab2">
    		<li>1</li>
    		<li>2</li>
    		<li>3</li>
    	</ul>
    </div>
    </body>
    </html>
    

     

    转载于:https://www.cnblogs.com/haicheng/p/3704251.html

    展开全文
  • Slider组件可以显示为垂直或是水平滑动条,可以使用鼠标拖动来设置其值。 其基本使用如下: // Create a vertical slider final Slider vertslider = new Slider(1, 100); vertslider.setOrientation(Slider....
  • Bootstrap Slider

    2020-11-26 23:59:37
    <div><p>| Q | A | --------------- | --- | Bug fix? | no | New feature? | no | New sample? | yes | Related issues? | n/a <h4>What's in this Pull Request?...pnp/sp-dev-fx-webparts</p></div>

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 779
精华内容 311
关键字:

webslider