fixed content api tooltips demo
This commit is contained in:
@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user