문제

I have this code to initialize selectboxit plugin (to convert select box to spans etc.) and it shows thing in the select box using Myriad font. Thats nice. However, when I select some option, it change from Myriad to Verdana (default font). How to refresh the cufon? Cufon.refresh(); is not working.

My code:

<script>

        $(document).ready(function(){

          $("select").selectBoxIt();

          Cufon.replace('input.btn-submit', { fontFamily: 'Myriad Pro' });

          Cufon.refresh();

        });

</script>
도움이 되었습니까?

해결책

Try refreshing the Cufont font each time the drop down changes. Like this:

        $(document).ready(function(){

          var select = $("select");

          select.selectBoxIt();

          refreshCufon();

          select.change(function() {

            refreshCufon();

          });          

          function refreshCufon() {

            Cufon.replace('input.btn-submit', { fontFamily: 'Myriad Pro' });

            Cufon.refresh();

          }

        });

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