Domanda

Orbit doesn't show. What i have done wrong? Note: I didn't change any documentation structure. Version 5

Code in head:

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

Code in body:

<div class="row">
<div class="orbit-container">
    <ul data-orbit class="example-orbit orbit-slides-container">
        <li> <img src="http://placehold.it/1000x300/A92B48/fff" alt="slide 1" />
            <div class="orbit-caption"> Caption One. </div>
        </li>
        <li class="active"> <img src="http://placehold.it/1000x300/EE964D/fff" alt="slide 2" />
            <div class="orbit-caption"> Caption Two. </div>
        </li>
        <li> <img src="http://placehold.it/1000x300/FDC43D/fff" alt="slide 3" />
            <div class="orbit-caption"> Caption Three. </div>
        </li>
    </ul>
    <!-- Navigation 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"></div>
    </div>
</div>
<!-- Bullets -->
<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>

Code before closing body:

<script src="js/vendor/jquery.js"></script> 
<script src="js/foundation.min.js"></script> 
<script>
      $(document).foundation({
  orbit: {
    animation: 'slide',
    timer_speed: 1000,
    pause_on_hover: true,
    animation_speed: 500,
    navigation_arrows: true,
    bullets: false
  }
});
    </script>

Please help! can some body provide me with simple working orbit code -----------------------Update----------- i tried this this simple code.. nothing happened

<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Foundation | Welcome</title>
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/modernizr.js"></script>
</head>
<body>
<div class="row">
    <ul class="example-orbit" data-orbit>
        <li> <img src="../assets/img/examples/satelite-orbit.jpg" alt="slide 1" />
            <div class="orbit-caption"> Caption One. </div>
        </li>
        <li> <img src="../assets/img/examples/andromeda-orbit.jpg" alt="slide 2" />
            <div class="orbit-caption"> Caption Two. </div>
        </li>
        <li> <img src="../assets/img/examples/launch-orbit.jpg" alt="slide 3" />
            <div class="orbit-caption"> Caption Three. </div>
        </li>
    </ul>
</div>
<script src="js/vendor/jquery.js"></script> 
<script src="js/foundation.min.js"></script> 
<script>
      $(document).foundation({
  orbit: {
    animation: 'slide',
    timer_speed: 1000,
    pause_on_hover: true,
    animation_speed: 500,
    navigation_arrows: true,
    bullets: false
  }
});
    </script>
</body>
</html>
È stato utile?

Soluzione

I was having the same issue. Found the answer here: http://foundation.zurb.com/forum/posts/1635-orbit-inside-of-reveal-modal...

In your CSS file, specify a minimum height for the class "orbit-container".

.orbit-container {
    min-height: 375px;
    height:100%;
}

Tweak to suit your needs, in regards to height of the element, default Background color (Should an image not load) or whatever you want really.

EDIT 1: You can also wrap your in a div tag and set your desired height there, the orbit slider should inherit it's height from there.

I have my slider set up as follows. I'm using the data-options tag to customize the slider with the options on this page under the "Advanced" header. Using the syntax from the "Real World Example" header right underneath it:

<ul data-orbit data-options="pause_on_hover:false;
                             slide_number: false;
                             timer: false;
                             variable_height:true;">
   <li><img src="http://placesheen.com/725/500" alt="sheen1"></li>
   <li><img src="http://placesheen.com/725/900" alt="sheen2"></li>
   <li><img src="http://placesheen.com/725/500" alt="sheen3"></li>
</ul>

If you just want to use all of the default settings, you can just get rid of data-options and set it up as follows:

<ul data-orbit>
  <li><img src="http://placesheen.com/725/500" alt="sheen1"></li>
  <li><img src="http://placesheen.com/725/900" alt="sheen2"></li>
  <li><img src="http://placesheen.com/725/500" alt="sheen3"></li>
</ul>

Hope this helps!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top