jquery - Bootstrap Data Attributes with Bootstrap Tour Plugin -


i'm newer bootstrap , i've started using plugin called bootstrap tour. http://bootstraptour.com/

i started learning data-attributes today, , i'm wondering if can/should use them bootstrap tour. bootstrap tour combo of included popover , tooltip plugins.

for instance, tours have steps, , steps have attributes can set when initiating tour. i'm trying able set placement, title, , content html element.

var tour = new tour();  tour.addsteps([   {     element: ".completed-range",     title: "",     content: ""   },   {     element: ".fph-row h1",     placement: 100,     title: "welcome <b>" + sectiontitle +"</b> tour!" ,     content: "proceed discover section's features."   }  ]); 

the above code creates tour 2 steps. first step targets element class "completed-range." html, i'd set placement, title, , content appears in step's popover/tooltip. this:

<div class="completed-range" data-placement="top" data-title="setting title" data-content="my content"> 

the div above populates content i'd like, placement , title aren't working. if use data-toggle="popover" or data-toggle="tooltip" bits , pieces work way want them to, not whole thing tour plugin. can point me in right direction?

well, pretty directly after wrote question, found half answer. so,

 {     element: ".completed-range",     title: "logout",     placement: $(".completed-range").data("placement"),      content: ""   }, 

i can inject constructor, did placement attribute. then,

<div class="completed-range" data-placement="top" data-content="testing content" data-original-title="title html"> 

will read "placement" value. liked having both ways though-- when specified data-content="whatever content is" in html, data-content value overrode had in constructor. liked that. hmmm oh well.

the github convo read injecting constructor


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -