为什么基金会4轨道不适合我?

时间:2013-11-15 19:09:15

标签: javascript html css zurb-foundation

我不确定为什么我的实施不起作用。我已经按照基础4网站上的文档,但无法弄清楚它为什么不起作用。显示的只是光标点,它改变了轨道中图像的位置。另外,我有正确的css / html / js文件夹路径。

以下是我的标记:

<!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>

  <!-- If you are using CSS version, only link these 2 files, you may add app.css to use for your overrides if you like. -->
  <link rel="stylesheet" href="foundation-4/css/normalize.css" />
  <link rel="stylesheet" href="foundation-4/css/foundation.css" />

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

</head>
<body>

  <!-- body content here -->

  <nav class="top-bar">
    <ul class="left">
        <li class="name"><font color="white"><a href="vm.php">Va</a></font></li>
    </ul>
    <ul class="right">
        <li class="name"><font color="white">Home</font></li>
    </ul>
  </nav>
  <br>

<!-- ======================== ORBIT===================== -->

<div class="orbit-container"> 
   <ul data-orbit="" class="orbit-slides-container">
    <li>
      <img src="3.jpg">
      <div class="orbit-caption">IMAGE 3</div>
    </li>
    <li class="active">
      <img src="1.jpg">
      <div class="orbit-caption">IMAGE 1</div>
    </li>
    <li>
      <img src="2.jpg">
      <div class="orbit-caption">IMAGE 2</div>
    </li>
    <li>
      <img src="3.jpg">
      <div class="orbit-caption">IMAGE 3</div>
    </li>
    <li>
      <img src="1.jpg">
      <div class="orbit-caption">IMAGE 1</div>
    </li>
  </ul>

  <!-- Prev/Next Arrows -->
  <a href="#" class="orbit-prev">Prev<span></span></a>
  <a href="#" class="orbit-next">Next<span></span></a>

  <!-- Slide Numbers -->
  <div class="orbit-slide-number">
    <span>1</span> of <span>3</span>
  </div>

  <!-- Timer and Play/Pause Button -->
  <div class="orbit-timer">
    <span></span>
    <div class="orbit-progress" style="width: 100%; -webkit-transition: width 10s linear;"></div>
  </div>

</div>

<!-- Orbit Bullet Slide Indicator -->
<ol class="orbit-bullets">
  <li data-orbit-slide-number="1"></li>
  <li data-orbit-slide-number="2" class="active"></li>
  <li data-orbit-slide-number="3"></li>
</ol>

<!-- =======ORBIT END======= -->


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

  <script>
  document.write('<script src=' +
  ('__proto__' in {} ? 'foundation-4/js/vendor/zepto' : 'foundation-4/js/vendor/jquery') +
  '.js><\/script>')
  </script>

  <script src="js/foundation/foundation.js"></script>
  <script src="js/foundation/foundation.orbit.js"></script>
  <script src="js/foundation/foundation.alerts.js"></script>
  <script src="js/foundation/foundation.clearing.js"></script>
  <script src="js/foundation/foundation.cookie.js"></script>
  <script src="js/foundation/foundation.dropdown.js"></script>
  <script src="js/foundation/foundation.forms.js"></script>
  <script src="js/foundation/foundation.joyride.js"></script>
  <script src="js/foundation/foundation.magellan.js"></script>
  <script src="js/foundation/foundation.orbit.js"></script>
  <script src="js/foundation/foundation.placeholder.js"></script>
  <script src="js/foundation/foundation.reveal.js"></script>
  <script src="js/foundation/foundation.section.js"></script>
  <script src="js/foundation/foundation.tooltips.js"></script>
  <script src="js/foundation/foundation.topbar.js"></script>
  <script src="js/foundation/foundation.interchange.js"></script>
  <script>
    $(document).foundation();
  </script>


</body>
</html>

此外,这是我在谷歌浏览器中获得的错误的屏幕截图。

http://s1228.photobucket.com/user/Ebadly/media/random/ScreenShot2013-11-15at112428AM_zpsdfc35907.png.html

2 个答案:

答案 0 :(得分:2)

编辑:基础论坛包含

<ul data-orbit="" class="orbit-slides-container">

REMOVE:=“”class =“orbit-slides-container”它为我做了一次:它变成了:

<ul data-orbit>

“Uncaught TypeError:Object#这是因为jQuery尚未加载。从这里下载jQuery http://jquery.com/download/

将此jQuery文件链接到您的网站

即使jQuery文件正确链接,也要确保它已加载到

中 加载基础javascript文件之前

<head></head>标记

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

  <!-- If you are using CSS version, only link these 2 files, you may add app.css to use for your overrides if you like. -->
  <link rel="stylesheet" href="foundation-4/css/normalize.css" />
  <link rel="stylesheet" href="foundation-4/css/foundation.css" />

<script src="LINKTO JQUERY JS FILE"></script>
  <script src="foundation-4/js/vendor/custom.modernizr.js"></script>

</head>

修改

<div class="row">
<div class="orbit-container"> 
   <ul data-orbit="" class="orbit-slides-container">
    <li>
      <img src="3.jpg">
      <div class="orbit-caption">IMAGE 3</div>
    </li>
    <li class="active">
      <img src="1.jpg">
      <div class="orbit-caption">IMAGE 1</div>
    </li>
    <li>
      <img src="2.jpg">
      <div class="orbit-caption">IMAGE 2</div>
    </li>
    <li>
      <img src="3.jpg">
      <div class="orbit-caption">IMAGE 3</div>
    </li>
    <li>
      <img src="1.jpg">
      <div class="orbit-caption">IMAGE 1</div>
    </li>
  </ul>
</div>
</div>

编辑:尝试这个

  <div class="large-12 columns">
            <div class="orbit-container">
                <ul data-orbit>
                    <li data-orbit-slide="headline-1">
                        <h2>Headline 1</h2>
                        <h3>Subheadline</h3>
                        <p>Pellentesque habitant morbi tristique senectus.</p>
                    </li>
                    <li data-orbit-slide="headline-2">
                        <h2>Headline 2</h2>
                        <h3>Subheadline</h3>
                        <p>Pellentesque habitant morbi tristique senectus.</p>
                    </li>

                </ul>

            </div>



        </div>

答案 1 :(得分:0)

它不会起作用,因为有AJAX调用来获取脚本。
如果你要在本地开发/测试,你将不得不使用像USBWebServer这样的东西。