jquerycsstwitter-bootstrapbootstrap-slider

Bootstrap-slider custom handle


I really don't understand why I can't manage to replace the original star handle by a picture of my own. Let's rely on that plunker to understand. I read the author's documentation on that matter: example 10

On the previous plunker I did as it's written that:

HTML:

<input id="ex10" type="text" data-slider-handle="custom"/>

CSS:

.slider-handle.custom {
  background: transparent url("http://icons.iconarchive.com/icons/custom-icon-design/pretty-office-8/128/Accept-icon.png");
}

The url background linked to the picture I want to see as handle. (Replacing the default star).

As you can see here: Plunker Picture - Enable to set background handle

New picture with Alexandr's comment below: Doesn't seem to change anything.

Alexandr's comment


Solution

  • Change this :

    .slider-handle.custom::before {
      line-height: 20px;
      font-size: 20px;
      content: '\2605';
      color: #726204;
    }
    

    to this :

     .slider-handle.custom::before {
          line-height: 20px;
          font-size: 20px;
          content: "url-of-your-picture";
          color: #726204;
        }
    

    You may have to do some adjustment to the line-height depending on the size of custom handle you want to use.