Hide tooltip after a period of time

2 posts, 0 answers
  1. Dan
    Dan avatar
    167 posts
    Member since:
    Nov 2017

    Posted 11 Oct 2018 Link to this post

    I need to show a tooltip on the items of a dropdownlist. However I would like for the tooltip to close after one second. I looked on the telerik forums and it seems that it exists but only for ajax AutoCloseDelay

    Can this be achieved also in kendo UI for jQuery?

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1208 posts

    Posted 15 Oct 2018 Link to this post

    Hi Dan,

    You are right that AutoCloseDalay configuration is currently not available out-of -the-box for the Tooltip widget. Nevertheless, similar functionality could be achieved by setting the autoHide configuration option to false and handling the show event of the widget:
    list.kendoTooltip({
      autoHide: false,
      filter: '.k-item',
      content: function(e) {
        var target = e.target;
         
        return target.text();
      },
      show: function(e) {
        var closeButton = $('.k-tooltip .k-i-close');
     
        if (closeButton.length > 0) {
          setTimeout(function() {
            closeButton.click();
          }, 1000);
        }
      }
    });

    Here you could a small sample implementing the above suggestion.

    Regards,
    Veselin Tsvetanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top