0

I try any times and cant now where is my error. Why it no work to me? it is "OWL CAROUSEL CUSTOM". I try many type of carousel owl and any run in my computer. I need so much that work please. here is de code i used in this moment HTML and CSS. I have all files in place in head of html. I now it is very easy to get right, but i cant do it.

#owl-demo .item{
  background: #3fbf79;
  padding: 30px 0px;
  margin: 10px;
  color: #FFF;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  text-align: center;
}
.customNavigation{
  text-align: center;
}
//use styles below to disable ugly selection
.customNavigation a{
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <title>Document</title>

<link rel="stylesheet" href="css/estilo.css">
<!-- Important Owl stylesheet -->
<link rel="stylesheet" href="css/owl.carousel.css">
 <!-- Default Theme -->
<link rel="stylesheet" href="css/owl.theme.css">
<!--  jQuery 1.7+  -->
<script src="js/jquery-1.9.1.min.js"></script>
 <!-- Include js plugin -->
<script src="js/owl.carousel.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<script>
 $(document).ready(function() {
 
  var owl = $("#owl-demo");
 
  owl.owlCarousel({
      items : 10, //10 items above 1000px browser width
      itemsDesktop : [1000,5], //5 items between 1000px and 901px
      itemsDesktopSmall : [900,3], // betweem 900px and 601px
      itemsTablet: [600,2], //2 items between 600 and 0
      itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
  });
 
  // Custom Navigation Events
  $(".next").click(function(){
    owl.trigger('owl.next');
  })
  $(".prev").click(function(){
    owl.trigger('owl.prev');
  })
  $(".play").click(function(){
    owl.trigger('owl.play',1000); //owl.play event accept autoPlay speed as second parameter
  })
  $(".stop").click(function(){
    owl.trigger('owl.stop');
  })
 
});
</script>

</head>
<body>
 <div id="owl-demo" class="owl-carousel owl-theme">
   <div class="item"><h1>1</h1></div>
   <div class="item"><h1>2</h1></div>
   <div class="item"><h1>3</h1></div>
   <div class="item"><h1>4</h1></div>
   <div class="item"><h1>5</h1></div>
   <div class="item"><h1>6</h1></div>
   <div class="item"><h1>7</h1></div>
   <div class="item"><h1>8</h1></div>
   <div class="item"><h1>9</h1></div>
   <div class="item"><h1>10</h1></div>
   <div class="item"><h1>11</h1></div>
   <div class="item"><h1>12</h1></div>
   <div class="item"><h1>13</h1></div>
   <div class="item"><h1>14</h1></div>
   <div class="item"><h1>15</h1></div>
   <div class="item"><h1>16</h1></div>
 </div>
  
 <div class="customNavigation">
   <a class="btn prev">Previous</a>
   <a class="btn next">Next</a>
   <a class="btn play">Autoplay</a>
   <a class="btn stop">Stop</a>
 </div>
 
</body>
</html>
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
GOLX
  • 1
  • 2
  • Please read the tag descriptions. This is not about [tag:owl], the Web Ontology Language. It's about [tag:owl-carousel]. I've retagged. – Joshua Taylor Feb 12 '16 at 16:02

1 Answers1

0

working demo

$(document).ready(function() {
 
  var owl = $("#owl-demo");
 
  owl.owlCarousel({
      items : 10, //10 items above 1000px browser width
      itemsDesktop : [1000,5], //5 items between 1000px and 901px
      itemsDesktopSmall : [900,3], // betweem 900px and 601px
      itemsTablet: [600,2], //2 items between 600 and 0
      itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
  });
 
  // Custom Navigation Events
  $(".next").click(function(){
    owl.trigger('owl.next');
  })
  $(".prev").click(function(){
    owl.trigger('owl.prev');
  })
  $(".play").click(function(){
    owl.trigger('owl.play',1000); //owl.play event accept autoPlay speed as second parameter
  })
  $(".stop").click(function(){
    owl.trigger('owl.stop');
  })
 
});
#owl-demo .item{
  background: #3fbf79;
  padding: 30px 0px;
  margin: 10px;
  color: #FFF;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  text-align: center;
}
.customNavigation{
  text-align: center;
}
//use styles below to disable ugly selection
.customNavigation a{
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
<link href="http://owlgraphic.com/owlcarousel/owl-carousel/owl.theme.css" rel="stylesheet"/>
<link href="http://owlgraphic.com/owlcarousel/owl-carousel/owl.carousel.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<script src="http://owlgraphic.com/owlcarousel/owl-carousel/owl.carousel.min.js"></script>

<div id="owl-demo" class="owl-carousel owl-theme">
   <div class="item"><h1>1</h1></div>
   <div class="item"><h1>2</h1></div>
   <div class="item"><h1>3</h1></div>
   <div class="item"><h1>4</h1></div>
   <div class="item"><h1>5</h1></div>
   <div class="item"><h1>6</h1></div>
   <div class="item"><h1>7</h1></div>
   <div class="item"><h1>8</h1></div>
   <div class="item"><h1>9</h1></div>
   <div class="item"><h1>10</h1></div>
   <div class="item"><h1>11</h1></div>
   <div class="item"><h1>12</h1></div>
   <div class="item"><h1>13</h1></div>
   <div class="item"><h1>14</h1></div>
   <div class="item"><h1>15</h1></div>
   <div class="item"><h1>16</h1></div>
 </div>
  
 <div class="customNavigation">
   <a class="btn prev">Previous</a>
   <a class="btn next">Next</a>
   <a class="btn play">Autoplay</a>
   <a class="btn stop">Stop</a>
 </div>

You have included two times jquery version..remove it and add jquery first in js section

Dhara
  • 1,914
  • 2
  • 18
  • 37
  • I cant make it work yet. Thanks so much for your answer. But i cant undastand html code. What you do to make work? Where i put those links? are in side de tag head? Add how jquery first? i include i need to creat a file for js? – GOLX Feb 12 '16 at 18:34
  • Thanks so much debin I reached success about it. Is it possible i make the owl carousel run left to right? it is to defaut run rigth to left. – GOLX Feb 15 '16 at 13:45
  • You can do `$('.your-carousel').owlCarousel({ rtl:true });` as mentioned in http://www.owlcarousel.owlgraphic.com/demos/rtl.html @GOLX – Dhara Feb 16 '16 at 04:21