fixed content api tooltips demo

This commit is contained in:
tomjohnson1492
2017-02-10 14:24:00 -08:00
parent 0152400034
commit 06dc9e0e25
9 changed files with 63 additions and 55 deletions

View File

@ -29,22 +29,21 @@ $.get( url, function( data ) {
/* Bootstrap popover text is defined inside a data-content attribute inside an element. That's
why I'm using attr here. If you just want to insert content on the page, use append and remove the data-content argument from the parentheses.*/
$.each(data.entries, function(i, item) {
if (item.id == "basketball") {
$( "#basketball" ).attr( "data-content", page.body );
}
$.each(data.entries, function(i, page) {
if (page.doc_id == "basketball") {
$( "#basketball" ).attr( "data-content", page.body );
}
if (item.id == "baseball") {
$( "#baseball" ).attr( "data-content", page.body );
}
if (page.doc_id == "baseball") {
$( "#baseball" ).attr( "data-content", page.body );
}
if (page.doc_id == "football") {
$( "#football" ).attr( "data-content", page.body );
}
if (item.id == "football") {
$( "#football" ).attr( "data-content", page.body );
}
if (item.id == "soccer") {
$( "#soccer" ).attr( "data-content", page.body );
}
if (page.doc_id == "soccer") {
$( "#soccer" ).attr( "data-content", page.body );
}
});
@ -78,3 +77,4 @@ body {padding-left:50px;}
<p>Football <span class="glyphicon glyphicon-info-sign" id="football" data-toggle="popover"></span></p>
<p>Soccer <span class="glyphicon glyphicon-info-sign" id="soccer" data-toggle="popover"></span></p>