【问题标题】:Galleria script not working in IE/Firefox [closed]Galleria 脚本在 IE/Firefox 中不起作用 [关闭]
【发布时间】:2012-12-03 01:17:24
【问题描述】:

textafwewaefweweawefweawefwaefwaefawefawe

【问题讨论】:

    标签: wordpress galleria


    【解决方案1】:

    您网站中的第一件事是包含两个 jquery 文件,请删除“jquery.min.js”文件。

    转到headre.php 文件并找到下面的wp_head() 函数包含“jquery.galleria.js”。

    “jquery.galleria.js”文件包括以下来自“jquery.js?ver=1.7.2”文件。

    【讨论】:

      【解决方案2】:

      说到 JS,我们都知道 IE 非常挑剔,而 FF 也是如此——Chrome 倾向于容忍小东西,但在 JS Linter 中仔细查看您的代码总是值得的为了安全起见。 通过 linter 运行脚本表明您在代码的第 33 行缺少分号。您指出我们的两个网站都存在同样的问题,所以我不确定它是否能解决您的问题,但它不会造成伤害,对吧?

      尝试使用它,看看是否有帮助:

      $(document).ready(function(){
          $('.gallery_demo_unstyled').addClass('gallery_demo'); // adds new class name to maintain degradability
          $('ul.gallery_demo').galleria({
              history   : true, // activates the history object for bookmarking, back-button etc.
              clickNext : true, // helper for making the image clickable
              insert    : '#main_image', // the containing selector for our main image
              onImage   : function(image,caption,thumb) { // let's add some image effects for demonstration purposes
                  // fade in the image and caption
                  if(! ($.browser.mozilla && navigator.appVersion.indexOf("Win")!=-1) ) { // FF/Win fades large images terribly slow
                      image.css('display','none').fadeIn(1000);
                  }
                  caption.css('display','none').fadeIn(1000);
                  // fetch the thumbnail container
                  var _li = thumb.parents('li');
                  // fade out inactive thumbnail
                  _li.siblings().children('img.selected').fadeTo(500,0.3);
                  // fade in active thumbnail
                  thumb.fadeTo('fast',1).addClass('selected');
                  // add a title for the clickable image
                  image.attr('title','Next image >>');
              },
              onThumb : function(thumb) { // thumbnail effects goes here
                  // fetch the thumbnail container
                  var _li = thumb.parents('li');
                  // if thumbnail is active, fade all the way.
                  var _fadeTo = _li.is('.active') ? '1' : '0.3';
                  // fade in the thumbnail when finnished loading
                  thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500);
                  // hover effects
                  thumb.hover(
                      function() { thumb.fadeTo('fast',1); },
                      function() { _li.not('.active').children('img').fadeTo('fast',0.3); } // don't fade out if the parent is active
                  ); // <-- Added semicolon
              }
          });
      });
      

      【讨论】:

      • 我还会检查您的任何其他 JS 文件中的控制台日志,因为这些文件永远不会导致 IE/FF 出现问题。
      猜你喜欢
      • 2013-09-28
      • 1970-01-01
      • 2011-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多