-4

我有一个从 Web 下载的下拉 javascript 工具栏和一个在 Dreamweaver 小部件浏览器上创建的灯箱。但是插入灯箱后,菜单栏不起作用。

http://alpineglass.biz/hardware.html

 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript" src="jquery.easing.1.3.js"></script>
    <script type="text/javascript">
        $(function() {
            /**
            * for each menu element, on mouseenter, 
            * we enlarge the image, and show both sdt_active span and 
            * sdt_wrap span. If the element has a sub menu (sdt_box),
            * then we slide it - if the element is the last one in the menu
            * we slide it to the left, otherwise to the right
            */
            $('#sdt_menu > li').bind('mouseenter',function(){
                var $elem = $(this);
                $elem.find('img')
                     .stop(true)
                     .animate({
                        'width':'170px',
                        'height':'170px',
                        'left':'0px'
                     },400,'easeOutBack')
                     .andSelf()
                     .find('.sdt_wrap')
                     .stop(true)
                     .animate({'top':'140px'},500,'easeOutBack')
                     .andSelf()
                     .find('.sdt_active')
                     .stop(true)
                     .animate({'height':'170px'},300,function(){
                    var $sub_menu = $elem.find('.sdt_box');
                    if($sub_menu.length){
                        var left = '170px';
                        if($elem.parent().children().length == $elem.index()+1)
                            left = '-170px';
                        $sub_menu.show().animate({'left':left},200);
                    }   
                });
            }).bind('mouseleave',function(){
                var $elem = $(this);
                var $sub_menu = $elem.find('.sdt_box');
                if($sub_menu.length)
                    $sub_menu.hide().css('left','0px');

                $elem.find('.sdt_active')
                     .stop(true)
                     .animate({'height':'0px'},300)
                     .andSelf().find('img')
                     .stop(true)
                     .animate({
                        'width':'0px',
                        'height':'0px',
                        'left':'85px'},400)
                     .andSelf()
                     .find('.sdt_wrap')
                     .stop(true)
                     .animate({'top':'25px'},500);
            });
        });
    </script>       

和另一个

             <script type='text/javascript' src='scripts/jquery.js'></script>
             <script type="text/javascript">
// BeginOAWidget_Instance_2127022: #gallery

    $(function(){
        $('#gallery a').lightBox({ 
            imageLoading:           '/images/lightbox/lightbox-ico-loading.gif',        // (string) Path and the name of the loading icon
            imageBtnPrev:           '/images/lightbox/lightbox-btn-prev.gif',           // (string) Path and the name of the prev button image
            imageBtnNext:           '/images/lightbox/lightbox-btn-next.gif',           // (string) Path and the name of the next button image
            imageBtnClose:          '/images/lightbox/lightbox-btn-close.gif',      // (string) Path and the name of the close btn
            imageBlank:             '/images/lightbox/lightbox-blank.gif',          // (string) Path and the name of a blank image (one pixel)
            fixedNavigation:        false,      // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
            containerResizeSpeed:   400,             // Specify the resize duration of container image. These number are miliseconds. 400 is default.
            overlayBgColor:         "#999999",      // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
            overlayOpacity:         .6,     // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
            txtImage:               'Image',                //Default text of image
            txtOf:                  'of'
        });
    });

// EndOAWidget_Instance_2127022

4

1 回答 1

0

您包括 2 个 jQuery 副本。不要那样做;这很可能是你的问题。


在第一个块中,您包含 3 个脚本,其中第一个是 jQuery:

// from Google CDN
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

在您的第二个块中,您再次包含 jQuery:

// From local
<script type='text/javascript' src='scripts/jquery.js'></script>

您应该只包含该库一次,如果本地副本与您从 Google 提取的副本类似,那么它们都已经过时了。

于 2013-09-12T17:11:01.923 回答