Cufon + SelectBoxIt combination ads three dots when I have 2 or more words in option

StackOverflow https://stackoverflow.com/questions/15229948

  •  18-03-2022
  •  | 
  •  

문제

I have a code like:

<script type="text/javascript">
            Cufon.replace('#select-stuff', { fontFamily: 'Myriad Pro' });
            Cufon.refresh('#select-stuff'); 
</script>

<script>
       $(document).ready(function(){

          // loading selectBoxIt
          var select = $("select");
          select.selectBoxIt();

          // code to fix reloading cufon on select change in select box
          refreshCufon();
          select.change(function() {
            refreshCufon();
          });          
          function refreshCufon() {
           Cufon.replace('#select-stuff', { fontFamily: 'Myriad Pro' });
           Cufon.refresh();
          }

        });
</script>

and it works but when I have e.g. 2 or more words in the option it goes wrong and instead of the words it add s three dots like this:

enter image description here

or

enter image description here

So it doesn't matter how many words tere are. it somehow replace the last word with three dots.

Any idea what is the problem?

도움이 되었습니까?

해결책

<style rel="stylesheet">
  .selectboxit-text {
    text-overflow: clip;
  }
</style>

다른 팁

If you use the default .css file provided with selectBoxIt, it contains an entry:

/* Button Text */
.selectboxit-text {
  ...
  text-overflow: ellipsis;
  ...
}

which adds the ellipsis (three dots) automatically when text is longer that the container. It's possible that changing the text-overflow will fix your issue, but it's hard to tell more without actual code.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top