Is it possibe to apply javascript to the tab images specified via ImageURL and HoveredImageUrl

6 posts, 1 answers
  1. Paul Squance
    Paul Squance avatar
    5 posts
    Member since:
    Jan 2010

    Posted 09 Mar 2010 Link to this post

    I know the template is available
  2. Answer
    Yana
    Admin
    Yana avatar
    5043 posts

    Posted 12 Mar 2010 Link to this post

    Hi Paul Squance,

    The other option is to use jquery to subscribe to click event of the images like this:

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ss" runat="server" />
        <div>
            <telerik:RadTabStrip ID="tabStrip1" runat="server">
                <Tabs>
                    <telerik:RadTab Text="tab 1" ImageUrl="images/1.gif" />
                    <telerik:RadTab Text="tab 2" ImageUrl="images/2.gif" />
                </Tabs>
            </telerik:RadTabStrip>
        </div>
        </form>
        <script type="text/javascript">
     
            function pageLoad() {
                var $ = $telerik.$;
     
                $('.rtsImg').click(function() {
                    alert("You clicked image for " + this.nextSibling.innerHTML);
                });
            }
        </script>
    </body>
    </html>

    Please try this and let us know how it goes.

    All the best,
    Yana
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Paul Squance
    Paul Squance avatar
    5 posts
    Member since:
    Jan 2010

    Posted 17 Mar 2010 Link to this post

    Yana,

    That's perfect.

    Thanks,

    Paul
  4. Paul Squance
    Paul Squance avatar
    5 posts
    Member since:
    Jan 2010

    Posted 24 Mar 2010 Link to this post

    The solution Yana gave I think involves static client library.  I can't see the click function listsed in the documentation for this functionality.  Is there a more expansive function list that is not published?

    I need to be able to identify if the tab clicked is the first tab and not fire a specified function in this case.
  5. Paul Squance
    Paul Squance avatar
    5 posts
    Member since:
    Jan 2010

    Posted 24 Mar 2010 Link to this post

    Please ignore the last paragraph the last post - I'm not concentrating!  But it would be good to know about any additional functionality
  6. Yana
    Admin
    Yana avatar
    5043 posts

    Posted 25 Mar 2010 Link to this post

    Hi Paul Squance,

    Actually it's the jquery library which is included in our scripts. Please check this blog post for more information.

    Best regards,
    Yana
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top