Saturday, 15 February 2014

javascript - how do you get the $this properties/attribute of bootstrap to be used as parameters -


How do I get this property of popover for Twitter Outlook parameter values, like I need to get the list item attribute Can I use data-booth type in the bootstrap popup title? Data-title is not enough though

HTML

  & lt; Li class = "booth" data-boothnumber = "46" data-booth type = "prime" style = "left: 240px; top: 30px;" & Gt; 46 & lt; / Li & gt;   

JS $ ('.booth'). PopOver ({title: this.data-boothtype + "'s" booth ", content:" test ", placement:" right ", callback: function () {console.log (this)}});

p.S. This.options.callback) {this.options.callback ();}}

edit is right below:

You must do

  $ ('.booth'). Each (function (i, v) {Var $ el = $ (v); $ el.popover ({Title: 'test' + $ el.data ('boothnumber'), content: "test", placement: "Right"});});   

Demo:

No comments:

Post a Comment