This code does not work. Also tried without JS, by putting attributes into <input>
. Nothing seems to work.
$('#radio1').tooltip({
placement: "bottom",
trigger: "hover"
});
<link rel="stylesheet" href=".3.6/css/bootstrap.min.css">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="options" id="radio1" autoplete="off"
data-toggle="tooltip" title="tooltip on radio!">Radio 1
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="radio2" autoplete="off">Radio 2
</label>
</div>
<script src=".11.3/jquery.min.js"></script>
<script src=".3.6/js/bootstrap.min.js"></script>
This code does not work. Also tried without JS, by putting attributes into <input>
. Nothing seems to work.
$('#radio1').tooltip({
placement: "bottom",
trigger: "hover"
});
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn./bootstrap/3.3.6/css/bootstrap.min.css">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="options" id="radio1" autoplete="off"
data-toggle="tooltip" title="tooltip on radio!">Radio 1
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="radio2" autoplete="off">Radio 2
</label>
</div>
<script src="https://ajax.googleapis./ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn./bootstrap/3.3.6/js/bootstrap.min.js"></script>
Share
Improve this question
edited Jul 7, 2016 at 19:51
Gleb Kemarsky
10.4k7 gold badges46 silver badges71 bronze badges
asked Jul 7, 2016 at 18:33
ProgZiProgZi
1,2674 gold badges17 silver badges30 bronze badges
1 Answer
Reset to default 6Try to apply tooltip's attributes to the <label>
:
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn./bootstrap/3.3.6/css/bootstrap.min.css">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary active" data-toggle="tooltip" data-placement="bottom" title="tooltip on radio!">
<input type="radio" name="options" id="radio1" autoplete="off">Radio 1
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="radio2" autoplete="off">Radio 2
</label>
</div>
<script src="https://ajax.googleapis./ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn./bootstrap/3.3.6/js/bootstrap.min.js"></script>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742339723a4425376.html
评论列表(0条)