Reputation: 2682
I have button in my MVC 3 view. Here it is:
<button rowId="@employee.Id" value="refresh" class="button-submit" class="btn btn-mini" style="border: 0; background: transparent; box-shadow: none;">
<img class="btn btn-mini" width="24" height="24" alt="Delete doctor" src="/Content/img/refresh.png" />
</button>
I want to show tooltip, so:
$(function () {
$(".button-submit").tooltip();
});
But is doesn't work in my case. How can I make them work?
Upvotes: 1
Views: 2709
Reputation: 81
Try this:
<button title="Your tooltip" class="btn btn-default">Add</button>
Upvotes: 0
Reputation: 26766
try changing class="button-submit" class="btn btn-mini"
to class="button-submit btn btn-mini"
Upvotes: 0
Reputation: 1002
Did you import the javascript for the tooltip plugin as well as the JQuery javascript?
Take a look at the example at the end of this page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" type="text/css" href="http://dev.jquery.com/view/trunk/plugins/tooltip/jquery.tooltip.css" />
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/tooltip/jquery.dimensions.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/tooltip/jquery.tooltip.js"></script>
<script>
$(document).ready(function(){
$("a").tooltip();
});
</script>
</head>
<body>
<a href="http://jquery.com" title="Write less, do more">jQuery.com</a>
<br/>
<a href="http://learningjquery.com" title="Learn more, write less">learningjQuery.com</a>
</body>
</html>
Upvotes: 1