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

RadRotator & jQuery

3 Answers 59 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Support
Top achievements
Rank 2
Support asked on 10 May 2013, 08:48 AM
Hi, we have a RadRotator in a DIV.
We have also jQuery code that do "slideUp" and "slideDown" of this DIV.

if I include <script src="js/jquery-1.9.1.min.js" /> RadRotator don't work fine, if I omit <script src="js/jquery-1.9.1.min.js" />, "slideUp" and "slideDown" don't work.

I have read this article

http://www.telerik.com/help/aspnet-ajax/introduction-using-jquery.html

but no solution suggested work fine

How is possible solve the problem?

3 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 15 May 2013, 07:28 AM
Hi,

It is strange that including the jQuery reference breaks the RadRotator on your page. As explained in the help article you linked, the jQuery object that is embedded in the RadControls for ASP.NET AJAX is available as $telerik.$ to avoid compatibility issues with versions that are already used.

Have you tried using only the alias $telerik.$? The version of jQuery that is available with the RadControls matches the one you are trying to include in your project.

I have also prepared a sample project that demonstrates a working RadRotator with externally referenced jQuery library. If you are still having difficulties, please check the sample and send step by step instructions for reproducing the problem so that I can inspect it locally and provide a more to the point answer.

All the best,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Support
Top achievements
Rank 2
answered on 17 May 2013, 09:30 AM
Thanks for the reply.
We have the release Q1 2012.
Perhaps the problem is due to RadAjaxPanel.
In your example if you add RadAjaxPanel, the example does not work properly


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RotatorSample.aspx.cs" Inherits="RotatorSample" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager runat="server" />
        <script type="text/javascript">
            $(document).ready(function () {
                $(".btnToggleDiv").click(function () {
                    if ($("div:first").is(":hidden")) {
                        $("div").slideDown();
                    } else {
                        $("div").slideUp("slow");
                    }
                });
            });
        </script>
    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="LoadingPanel1" Height="100%" Width="100%">
        <div style="width: 200px; height: 150px;">
            <telerik:RadRotator ID="RadRotator1" runat="server" FrameDuration="3000" RotatorType="Buttons"
                Height="113px" ItemHeight="113px" Width="190px" ItemWidth="150px"
                Skin="Default">
                <ItemTemplate>
                    <img src="<%# ResolveUrl("images/" + Container.DataItem) %>" alt="" />
                </ItemTemplate>
            </telerik:RadRotator>
        </div>
    </telerik:RadAjaxPanel>
        <input type="button" class="btnToggleDiv" value="Show/hide rotator" />
    </form>
</body>
</html>
0
Slav
Telerik team
answered on 21 May 2013, 12:49 PM
Hello,

Indeed, when you add the RadAjaxPanel there is a problem with the slide down animation. This happens because the selector in your script no longer references the div element that wraps the RadRotator. Please add an id that will help reference the correct div element as shown in the following code sample:
<script type="text/javascript">
    $(document).ready(function () {
        $(".btnToggleDiv").click(function () {
            if ($("div#rotatorContainer").is(":hidden")) {
                $("div#rotatorContainer").slideDown();
            } else {
                $("div#rotatorContainer").slideUp("slow");
            }
        });
    });
</script>
<input type="button" class="btnToggleDiv" value="Show/hide rotator" />
<telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="LoadingPanel1" Height="100%" Width="100%">
    <div id="rotatorContainer" style="width: 200px; height: 150px;">
        <telerik:RadRotator ID="RadRotator1" runat="server" FrameDuration="3000" RotatorType="Buttons"
            Height="113px" ItemHeight="113px" Width="190px" ItemWidth="150px"
            Skin="Default">
            <ItemTemplate>
                <img src="<%# ResolveUrl("images/" + Container.DataItem) %>" alt="" />
            </ItemTemplate>
        </telerik:RadRotator>
    </div>
</telerik:RadAjaxPanel>


Regards,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Rotator
Asked by
Support
Top achievements
Rank 2
Answers by
Slav
Telerik team
Support
Top achievements
Rank 2
Share this question
or