1

我正在使用 asp.net 菜单控件,但我需要向它添加一个滑块,因此如果菜单控件在可见页面之外增长,那么这会限制它并使用 jquery 滑块来查看隐藏的其他选项。我已经尝试过 Jcarousel 和现在这个,但已经能够正确地实现它。发生 2 件事:

  1. 项目是隐藏的,无论我点击什么都不会显示它们。
  2. 子菜单不再出现。

对于我可以使用的更好插件的任何帮助或指导,我将不胜感激。

    <link href="css/jquery.thumbnailScroller.css" rel="stylesheet" />
    <!-- Add jQuery library -->
    <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
    <!-- jquery ui custom build (for animation easing) -->
    <script src="js/jquery-ui-1.8.13.custom.min.js"></script>
    <script>
        /* jQuery.noConflict() for using the plugin along with other libraries.
        You can remove it if you won't use other libraries (e.g. prototype, scriptaculous etc.) or
        if you include jQuery before other libraries in yourdocument's head tag.
        [more info: http://docs.jquery.com/Using_jQuery_with_Other_Libraries] */
        /* calling thumbnailScroller function with options as parameters */
        (function ($) {

            window.onload = function () {

                $("#tS2").thumbnailScroller({
                    scrollerType: "clickButtons",
                    scrollerOrientation: "horizontal",
                    scrollSpeed: 2,
                    scrollEasing: "easeOutCirc",
                    scrollEasingAmount: 600,
                    acceleration: 4,
                    scrollSpeed: 800,
                    noScrollCenterSpace: 10,
                    autoScrolling: 0,
                    autoScrollingSpeed: 2000,
                    autoScrollingEasing: "easeInOutQuad",
                    autoScrollingDelay: 500
                });
            }
        });
    </script>
    <!-- thumbnailScroller script -->
    <script src="js/jquery.thumbnailScroller.js"></script>


    <div id="tS2" class="jThumbnailScroller">
        <div class="jTscrollerContainer">
            <div class="jTscroller">    
                <asp:Menu ID="navigation" runat="server" Orientation="Horizontal" CssClass="topmenu" MaximumDynamicDisplayLevels="20" 
                    IncludeStyleBlock="false">
                   <DynamicSelectedStyle />
                    <DynamicMenuItemStyle />
                    <DynamicHoverStyle  />
                    <DynamicMenuStyle   />
                    <StaticMenuItemStyle  />
                    <StaticSelectedStyle />
                    <StaticHoverStyle  />
                </asp:Menu>
            </div>
       </div>
       <a href="#" class="jTscrollerPrevButton"></a>
       <a href="#" class="jTscrollerNextButton"></a>
    </div>
4

1 回答 1

0

看起来您缺少()匿名包装函数上的后缀,因此该window.onload块将永远不会执行。

您是否在控制台中收到任何错误?

于 2012-02-27T19:20:30.823 回答