2017-01-23 4 views
2

なぜ私は元のスターハンドルを自分の写真で置き換えることができないのか分かりません。 そのことを理解するためにplunkerに頼りましょう。 は、私はその問題にauthor's documentationをお読みください。例10ブートストラップスライダのカスタムハンドル

私は以前plunkerにそれが書かれていますように、その:

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"); 
} 

URL私はハンドルとして見たい画像にリンクされた背景。 (デフォルトの星の置き換え)。

あなたがここに見ることができるよう:以下アレクサンドルさんのコメント付きPlunker Picture - Enable to set background handle

新しい写真: は何も変更していないようです。あなたインスタンス化されたスライダー場合

Alexandr's comment

+0

前に、私はあなたのdiv .slider-handle.customを参照してくださいいけません。 #ex10 {// css} –

+0

これは何も変わりません。私は別の画像を更新しました。 – BoobaGump

+0

この例では、http://embed.plnkr.co/D3GJQn/preview starは擬似要素の前です –

答えて

2

変更を変更され、この:これに

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

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

使用するカスタムハンドルのサイズに応じて、線の高さを調整する必要がある場合があります。

0

は、それではあなたがする必要があるすべてはあなたのCSS

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

/* Or display content like unicode characters or fontawesome icons */ 
.slider-handle.custom::before { 
    line-height: 20px; 
    font-size: 20px; 
    /* Comment this because you will not use star */ 
    /*content: '\2605'; /*unicode star character*/ 
    color: #726204;*/ 
} 
+0

しました。 plunkerの最後のスクリーンショットで見ることができます。 – BoobaGump

0

あなたはスライダーhandle.customをオーバーライドする必要があります::

.slider-handle.custom::before { 
     display:none 
} 
関連する問題