Your search did not match any results.
Tooltip

Tooltip

The Tooltip component can display a tooltip for an element on the page. To bind the Tooltip to an element, use the target property.

Show and Hide the Tooltip

Specify DOM events in the target element's markup that need to be triggered to change the Tooltip's visibility. Bind the visible property of the Tooltip to a variable and use event handlers to toggle this variable.

To hide the Tooltip when a user clicks outside its borders, use the hideOnOutsideClick property.

Customize and Animate the Tooltip

Assign the Tooltip's content in the HTML markup. Alternatively, you can use the content template to customize the Tooltip's content.

If you need to position the Tooltip at a certain side of the target element, specify the position property.

To animate the Tooltip, declare the animation object. In this object, specify the show and hide fields.

Backend API
Copy to CodePen
Apply
Reset
const DemoApp = angular.module('DemoApp', ['dx']); DemoApp.controller('DemoController', ($scope) => { $scope.defaultModeOptions = { target: '#product1', showEvent: 'mouseenter', hideEvent: 'mouseleave', hideOnOutsideClick: false, }; $scope.withTemplateOptions = { target: '#product2', showEvent: 'mouseenter', hideEvent: 'mouseleave', hideOnOutsideClick: false, position: 'right', contentTemplate(data) { data.html("<img width='150' src='../../../../images/products/3.png'><br/><b>SuperPlasma 50</b><br/>2400$"); }, }; $scope.withAnimationOptions = { target: '#product3', showEvent: 'mouseenter', hideEvent: 'mouseleave', hideOnOutsideClick: false, position: 'top', animation: { show: { type: 'slide', from: { top: -100, opacity: 0, }, to: { opacity: 1, top: 0, }, }, hide: { type: 'pop', from: { scale: 1, opacity: 1, }, to: { opacity: 0, scale: 0.1, }, }, }, }; });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/22.1.6/css/dx.common.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/22.1.6/css/dx.light.css" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script> <script>window.angular || document.write(decodeURIComponent('%3Cscript src="js/angular.min.js"%3E%3C/script%3E'))</script> <script src="https://cdn3.devexpress.com/jslib/22.1.6/js/dx.all.js"></script> <link rel="stylesheet" type="text/css" href="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container" ng-app="DemoApp" ng-controller="DemoController"> <div class="form"> <div class="label">Default mode</div> <div> <img id="product1" src="images/products/17.png" /> <div id="tooltip1" dx-tooltip="defaultModeOptions">ExcelRemote IR</div> </div> <div class="label">With template</div> <div> <img id="product2" src="images/products/3.png" /> <div id="tooltip2" dx-tooltip="withTemplateOptions"></div> </div> <div class="label">With animation</div> <div> <img id="product3" src="images/products/15.png" /> <div id="tooltip3" dx-tooltip="withAnimationOptions">Projector PlusHD</div> </div> </div> </div> </body> </html>
.form { padding: 20px; } .form img { width: 100px; margin: 10px 0 30px; } .label { font-size: 16px; }