0

I have seen this many places. The scrolling changes value.

enter image description here

How to create this in html and what is this called?

Edit: People are thinking its a dropdown but that arrow moves left to right and value gets changed.

6
  • It's custom dropdown with scroll listener. Use js/jQuery for that. Commented Jan 11, 2017 at 9:39
  • It's called <select> attribute Commented Jan 11, 2017 at 9:40
  • any idea how to make? Commented Jan 11, 2017 at 9:41
  • If you want the style like that, you will need to have the css rules. But to create a simple <select> see this link Commented Jan 11, 2017 at 9:44
  • thats not select. I am asking about slider that arrow moves left to right. Commented Jan 11, 2017 at 9:50

2 Answers 2

1

Updated example using slider

Here's an example.

var steps = [
    "one",
    "two",
    "three",
    "four",
    "five"
];

$(function() {
    $(".slider").slider({
        value: 0,
        min: 0,
        max: 4,
        step: 1,
        slide: function(event, ui) {
            $(".b").html(steps[ui.value]);
        }
    });
    $(".b").val(steps[$(".slider").slider("value")]);
});
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800);
html,body{
  font-family: 'Open Sans', sans-serif;
  background-color: #fff;
  text-align: center;
  color: #212121;
}
h1{
  text-transform: capitalize;
  font-weight: 100;
  font-size: 42px;
  border-bottom: 1px dashed  #ccc;
  
  padding-bottom: 30px;
  color: #454545;
}
.container{
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
}

.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default{
  
  background-color: #fff;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
  
}
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default{
  background: none;
}
.ui-slider-horizontal .ui-slider-handle{
  top: -.5em;
}
.ui-slider-horizontal{
  height: .4em;
  border: 0;
  background-color: #e8e8e8;
  
  
}
.b{
  margin-top:20px;
  font-weight: 100;
  text-align: center;
  display: inline-block;
  background-color: #00CEAF;
  color: #fff;
  padding: 30px;
  border-radius: 3px;
  min-width: 200px;
  transition: all .3s;
  font-size: 20px;
  
  &:hover{
    background-color: darken(#00CEAF,5%);
    
  }
}

  
    height: 1.2em;
    width: 1.2em;

    background-color: #00CEAF  ;
      &:hover,&:focus,&:active{
    background-color: #00CEAF;
        
  }
  }

.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default{border-color: #a3a3a3;}
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default{
     -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  background-color: #a3a3a3;
  outline: 0;
  &:hover,&:focus,&:active{
    outline: 0;
    background-color: #00CEAF;
    border-color:  #00CEAF;
  }
  &:hover{
    background-color: #fff;
    &:active{
      background-color: #00CEAF;
    }
  }
}
<link href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>

<div class="container">
  <h1>Current value is : </h1>
<div class="b">one</div>
<div class="slider"></div>

Sign up to request clarification or add additional context in comments.

2 Comments

I am not asking about dropdown. i am trying to make that slider thing.
Thanks this is what I was looking for.
0

You can't do this with HTML.

If you want to use a form for option select with HTML you can do something like this:

<select>
  <option value="1">One</option> 
  <option value="2">Two</option> 
</select>

To design the form with the colors and shapes you like you can use CSS. You can also use some dropdown plugin.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.