Как избежать конфликтов jquery fancy box и прокрутки мыши

#jquery

#jquery

Вопрос:

     <script src="js/jquery-1.9.1.js"></script>
    <?php include("fancybox/fb.php"); ?>
    <script type="text/javascript" src="js/jquery.slimscroll.js"></script>
    <script type="text/javascript">

    $(document).ready(function() {
    /*
     *  Simple image gallery. Uses default settings

     */
    /*scroll page*/

     $('#testDiv').slimScroll({
          railVisible: true,
          railColor: '#f00'
      });
      jQuery.noConflict();
     $('.fancybox').fancybox();


/*fancy Box */   
     $('.fancybox-buttons').fancybox({
        openEffect  : 'none',
        closeEffect : 'none',
        prevEffect : 'none',
        nextEffect : 'none',
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600, 
        'speedOut'      :   200, 
        closeBtn  : false,

        helpers : {
        title : {
        type : 'inside'
        },
        buttons : {}
        },

        afterLoad : function() {
        this.title = 'Image '   (this.index   1)   ' of '   this.group.length   (this.title ? ' - '   this.title : '');
        }
        });




        });


        </script>
  

Комментарии:

1. укажите URL вашего сайта, пожалуйста, не указывайте его на localhost.

2. Действительно, это localhost

Ответ №1:

Плагин SlimScroll эмулирует прокрутку, обрабатывая событие mousewheel над областью прокрутки, и может быть причиной конфликта JS с встроенной прокруткой или другим js-кодом. Попробуйте jQuery Scrollbar, который использует встроенную прокрутку браузера без обработки / предотвращения события mousewheel. Или попробуйте любую из полос прокрутки с собственным типом из этой таблицы сравнения полос прокрутки