1

I downloaded a plugin called anno.js few days a go, I dont really good in js code. I want to custom a built-in button in this plugin. Is there anyone ever do this before?

All I want to do is to custom this Skip button Built in button

become this one

enter image description here

this is my js code

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]
ronydavid
  • 391
  • 1
  • 2
  • 11

2 Answers2

2

If you edit the .anno-btn class you will edit all the buttons. You have to add a specific classname to your button so you can then select it through css.

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

I would suggest selecting the button with the specific text you want .

$('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>
l.g.karolos
  • 1,131
  • 1
  • 10
  • 25
0

Anon.js has its css file. You either edit the css directly or create yours

.anno-btn {
//define your styles here
}
Samuel James
  • 1,528
  • 16
  • 15