This is a migrated thread and some comments may be shown as answers.

Tooltip on image hover

1 Answer 160 Views
ImageGallery
This is a migrated thread and some comments may be shown as answers.
BoaMike
Top achievements
Rank 2
BoaMike asked on 31 Mar 2015, 02:21 PM
I'm trying to figure out how I can display a tooltip when hovering over an image.  I'm using advanced binding and fetching the data from a database.  I would like the tooltip to contain information from the datasource.  I'm using this in the context of Sitefinity 7.3 which is using version 2014.3.1209 of RadControls, so I can't use an ItemTemplate.  Any ideas on how this can be achieved?

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 03 Apr 2015, 11:22 AM
Hi,

Currently the RadImageGallery control does not support such functionality. In order to implement this you can use our RadToolTipManager and create a tool tip dynamically on the client as demonstrated here. The general idea behind such an implementation would be to attach a hover event handler for the RadImageGallery image area(example provided below), get the currently selected item(for that purpose you can use - get_selectedItem()) and generate a tool tip.

JavaScript:
function pageLoad() {
    $telerik.$('.rigActiveImage').hover(function () {
        var imageGallery = $find('<%=RadImageGallery1.ClientID%>');
        var selectedItem = imageGallery.get_selectedItem();
        var imageTitle = selectedItem.get_title();
           // generate tool tip
    });
}

Regards,
Angel Petrov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
ImageGallery
Asked by
BoaMike
Top achievements
Rank 2
Answers by
Angel Petrov
Telerik team
Share this question
or