2017-11-01 42 views
0

anno.jsというプラグインをダウンロードしました。数日はかかりますが、jsコードは本当にうまくいきません。このプラグインでは、カスタムボタンにビルトインボタンが必要です。これまで誰もこれをやっていますか?anno.js - anno.jsのカスタムボタンの使い方

私がやりたいことはすべて、このスキップボタン Built in button

はこの1つ

enter image description here

これは私のJSコード

var anno8 = new Anno([{ 
     target: '.guides', 
     position: 'left', 
     content: "Add another app or manage existing ones by going to <b>‘My Applications’</b> through this menu button", 
     buttons:[{ 
      text:'Skip', 
      click: function(anno,evt){ 
       anno.hide(); 
       //$('#dialog').modal('show'); 
      } 
     },AnnoButton.NextButton] 

答えて

1

を作成するのいずれか。 ボタンに特定のクラス名を追加する必要があります。その場合、cssからボタンを選択することができます。

var intro = new Anno([ 
       { 
       ... 
       buttons:[{ 
       text:'Skip', 
       className: 'anno-btn-skip', 
       }] 
       ... 
       }, 
      ]); 

希望のテキストでボタンを選択することをおすすめします。

私が見

$('document').ready(function(){ 
 
     var intro = new Anno([ 
 
       { 
 
       target:'#first', 
 
       content: "Hello world!", 
 
       buttons:[{ 
 
       text:'Skip', 
 
       className: 'anno-btn-skip', 
 
       }] 
 
       }, 
 
      ]); 
 
     $('#clickMe').on('click',function(e){ 
 
     intro.show(); 
 
     }); 
 
});
.element{ 
 
    height:100px; 
 
    width:100px; 
 
    border:2px solid green; 
 
    margin:0px auto; 
 
} 
 

 
.anno-btn-container > .anno-btn-skip {  
 
    background-color: white!important; 
 
    color: #0d7fad!important; 
 
    border: 1px solid #0d7fad!important; 
 
    border-radius: 0.6em!important; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> 
 
<script src="https://rawgit.com/iamdanfox/anno.js/gh-pages/dist/anno.js" type="text/javascript"></script> 
 
<script src="https://rawgit.com/litera/jquery-scrollintoview/master/jquery.scrollintoview.js" type="text/javascript"></script> 
 

 
<link href="https://rawgit.com/iamdanfox/anno.js/gh-pages/dist/anno.css" rel="stylesheet" type="text/css" /> 
 

 
    <div id="first" class="first element">First Element</div> 
 
    <a href="#" type="button" id="clickMe">ClickMe</a>

+0

htmlタグ私はそれらを検査する場合 – ronydavid

+0

を持っていないので、これは彼らのである、ボタンをスキップするために、余分なクラスを追加する方法を –

+0

を私は' skip'ボタンを選択しています理由です同じクラス – ronydavid

0

あるAnon.jsはそのを持っているとなっカスタムにありCSSファイル。あなたは.anno-BTNクラスを編集した場合は、すべてのボタンを編集します直接CSSを編集したり、あなたに

.anno-btn { 
//define your styles here 
} 
+0

ので、どのようにスキップするように、余分なクラスを追加するには?私はそれらを点検した場合、すべてのボタンはすべて '.anno-btn' – ronydavid

関連する問題