Domanda

Error message http://puu.sh/3ip7L

This error is appearing for me constantly. If I upload the foundation.4.2 folder directly the index.html file runs fine, but as soon as I try to access them from anywhere else, I get the orbit error.

Here is some of the code:

Calling modernizr.js

<script src='<?php echo get_stylesheet_directory_uri();?>/js/vendor/custom.modernizr.js'></script>

Getting Zepto/jquery:

    <script>document.write('<script src=<?php echo get_stylesheet_directory_uri();?>/js/vendor/' +
  ('__proto__' in {} ? 'zepto' : 'jquery') +
  '.js><\/script>')
  </script>

Calling foundation.js and orbit.js

      <script src="<?php echo get_stylesheet_directory_uri(); ?>/js/foundation.min.js"></script>
<script src="<?php echo get_stylesheet_directory_uri(); ?>/js/foundation/foundation.orbit.js"></script>

and then I initialize foundation and call orbit.js.

<script>
    $(document).foundation();
</script>
<script type="text/javascript">
$(window).load(function() {
  $('#featured').orbit({ fluid: '2x1' });
});
</script>

Yet for some reason the error persists. Can someone help please?

È stato utile?

Soluzione

Below is a sample Orbit. You can modify it as you need or just delete the body entirely and rewrite your code (don't delete the Js tho). Not sure what is exactly wrong with your code but the last Js snippet doesn't look right to me.

<!DOCTYPE html>
<!--[if IE 8]>         <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width" />
  <title>Foundation 4</title>

  <link rel="stylesheet" href="css/normalize.css" />
  <link rel="stylesheet" href="css/foundation.min.css" />
  <link rel="stylesheet" href="css/app.css" />

  <script src="js/vendor/custom.modernizr.js"></script>

</head>
<body>
    <div class="row">
        <div class="large-10 large-centered columns">
        <ul>
          <li><img src="img/banners/1.jpg"></li>
          <li><img src="img/banners/2.jpg"></li>
          <li><img src="img/banners/3.jpg"></li>
          <li><img src="img/banners/4.jpg"></li>
          <li><img src="img/banners/5.jpg"></li>
        </ul>
      </div>
  </div>
  <script>
  document.write('<script src=' +
  ('__proto__' in {} ? 'js/vendor/zepto' : 'js/vendor/jquery') +
  '.js><\/script>')
  </script>
  <script src="js/foundation.min.js"></script>
  <script>
  $(document).foundation();
  </script>
</body>
</html>`
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top