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

Get item when mouse over

1 Answer 60 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Edwin
Top achievements
Rank 1
Edwin asked on 22 Jun 2009, 03:20 PM
Hi

Can you show me an example about how to get the item in rotator when mouse over?  I know I need a javascript function to handle the mouseover event but I don't know how to write the handler to get the item which has the mouse over.

Thanks in advance
Edwin

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 25 Jun 2009, 10:39 AM
Hi Edwin,

For this purpose you should use the OnClientMouseOver handler and then use the client-side API to get the needed information.
for example:

<form id="form1" runat="server"
<asp:ScriptManager ID="ScriptManager1" runat="server"
</asp:ScriptManager> 
<script type="text/javascript"
 
    function OnClientMouseOver(sender,args) 
    { 
 
        alert("current item's index is: \n" + sender.get_currentItem().get_index()); 
    } 
 
</script> 
 
<telerik:RadRotator ID="RadRotator1" OnClientMouseOver="OnClientMouseOver" RotatorType="AutomaticAdvance" 
    ScrollDirection="Up" ScrollDuration="2000" runat="server" DataSourceID="xmlDataSource1" 
    Width="500" Height="100" ItemHeight="100" FrameDuration="0"
    <ItemTemplate> 
        <div class="module" style="width: 500px"
            <strong><a href='<%# XPath("link") %>' target="_blank"
                <%# XPath("title") %> 
            </a></strong
            <br /> 
            <%# XPath("pubDate") %> 
        </div> 
    </ItemTemplate> 
</telerik:RadRotator> 
<asp:XmlDataSource ID="xmlDataSource1" XPath="rss/channel/item" runat="server" DataFile="http://www.telerik.com/support.rss"
</asp:XmlDataSource> 
</form> 


All the best,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Rotator
Asked by
Edwin
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or