0
votes

Is it possible to disable animation in kendo tabstrip when we adding the tab.we have tried this below code @(Html.Kendo().TabStrip() .Name("tabstrip")

                          .Events(events => events
                                .Select("onSelect")
                            )
                             .Animation(animation =>
                            {
                                animation.Enable(false);
                            })

)

but its not working for me.please provide solution for this.

2

2 Answers

0
votes

Below,I used javascript configuration to achieve your purpose.It worked perfectly. Then I paste an MVC version of same code. It worked well as well. So I think source of the problem underlie of the rest of your code or kendo version. JavaScript Configuration here :

<!DOCTYPE html>
<html>
<head>
    <base href="http://demos.telerik.com/kendo-ui/tabstrip/index">
    <style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
    <title></title>
    <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.3.1118/styles/kendo.common-material.min.css" />
    <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.3.1118/styles/kendo.material.min.css" />
    <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.3.1118/styles/kendo.material.mobile.min.css" />

    <script src="//kendo.cdn.telerik.com/2016.3.1118/js/jquery.min.js"></script>
    <script src="//kendo.cdn.telerik.com/2016.3.1118/js/kendo.all.min.js"></script>
</head>
<body>

        <div id="example">
                <div class="demo-section k-content">
                        <div id="tabstrip">
                            <ul>
                                <li class="k-state-active">
                                    Paris
                                </li>
                                <li>
                                    New York
                                </li>
                                <li>
                                    London
                                </li>
                                <li>
                                    Moscow
                                </li>
                            </ul>
                            <div>
                                <span class="rainy">&nbsp;</span>
                                <div class="weather">
                                    <h2>17<span>&ordm;C</span></h2>
                                    <p>Rainy weather in Paris.</p>
                                </div>
                            </div>
                            <div>
                                <span class="sunny">&nbsp;</span>
                                <div class="weather">
                                    <h2>29<span>&ordm;C</span></h2>
                                    <p>Sunny weather in New York.</p>
                                </div>
                            </div>
                            <div>
                                <span class="sunny">&nbsp;</span>
                                <div class="weather">
                                    <h2>21<span>&ordm;C</span></h2>
                                    <p>Sunny weather in London.</p>
                                </div>
                            </div>
                            <div>
                                <span class="cloudy">&nbsp;</span>
                                <div class="weather">
                                    <h2>16<span>&ordm;C</span></h2>
                                    <p>Cloudy weather in Moscow.</p>
                                </div>
                            </div>
                        </div>
                </div>

            <style>
                .sunny, .cloudy, .rainy {
                    display: block;
                    margin: 30px auto 10px;
                    width: 128px;
                    height: 128px;
                    background: url('../content/web/tabstrip/weather.png') transparent no-repeat 0 0;
                }

                .cloudy{
                    background-position: -128px 0;
                }

                .rainy{
                    background-position: -256px 0;
                }

                .weather {
                    margin: 0 auto 30px;
                    text-align: center;
                }

                #tabstrip h2 {
                    font-weight: lighter;
                    font-size: 5em;
                    line-height: 1;
                    padding: 0 0 0 30px;
                    margin: 0;
                }

                #tabstrip h2 span {
                    background: none;
                    padding-left: 5px;
                    font-size: .3em;
                    vertical-align: top;
                }

                #tabstrip p {
                    margin: 0;
                    padding: 0;
                }
            </style>

            <script>
                $(document).ready(function() {
                    $("#tabstrip").kendoTabStrip({
                        animation:  false
                    });
                });
            </script>
        </div>


</body>
</html>

with MVC Razor, try this:

@(Html.Kendo().TabStrip()
  .Name("tabstrip")
  .Animation(a=>a.Enable(false))
  .Items(tabstrip =>
  {
  tabstrip.Add().Text("Paris")
          .Selected(true)
          .Content(@<text>
            <div class="weather">
                <h2>17<span>&ordm;C</span></h2>
                <p>Rainy weather in Paris.</p>
            </div>
            <span class="rainy">&nbsp;</span>
        </text>);
  tabstrip.Add().Text("New York")
        .Content(@<text>
        <div class="weather">
            <h2>29<span>&ordm;C</span></h2>
            <p>Sunny weather in New York.</p>
        </div>
        <span class="sunny">&nbsp;</span>
        </text>);
tabstrip.Add().Text("Moscow")
        .Content(@<text>
        <div class="weather">
            <h2>16<span>&ordm;C</span></h2>
            <p>Cloudy weather in Moscow.</p>
        </div>
        <span class="cloudy">&nbsp;</span>
        </text>);
tabstrip.Add().Text("Sydney")
        .Content(@<text>
        <div class="weather">
            <h2>17<span>&ordm;C</span></h2>
            <p>Rainy weather in Sidney.</p>
        </div>
        <span class="rainy">&nbsp;</span>
        </text>);
      })
)
0
votes

I had the same issue because in my js code I was using

$("#tabstrip").kendoTabStrip().data('kendoTabStrip')

.kendoTabStrip() here initializes tabstrip component again with enabled animation. It is not that obvious when you initialize it using MVC. So solution for me was to change line to:

$("#tabstrip").data('kendoTabStrip')

https://www.telerik.com/forums/kendo-mvc-tabstrip-disable-animation-animation-getting-reenabled-on-javascript-select-of-tab#xue8Abeu5U2IWvtZDE0CGA