Search code examples
backbone.jscluetip

How to use cluetip with backbonejs


Is there any example code showing use of cluetip with backboneJS? on click of button i want to show a cluetip popup. But I found no example for this.


Solution

  • Backbone shouldn't change how you use cluetip here is the example

    HTML

    <script type="text/template" id="template1">
        <p> <a id = "houdini"
        href = "houdini.html"
        title = "|Houdini was an escape artist.|He was also adept at prestidigitation." > Houdini </a></p>
    </script>
    <div id="container"></div>
    

    JavaScript

    var MyView = Backbone.View.extend({
    
        render: function () {
            this.$el.html($('#template1').html());
            this.$('#houdini').cluetip({
                splitTitle: '|', 
                showTitle: false 
            });
        }
    })
    
    
    var view = new MyView({
        el: '#container'
    })
    
    view.render();