flipe Posted February 10, 2016 at 03:53 PM Report Share #593311 Posted February 10, 2016 at 03:53 PM Viva. Estou a tentar construir um site e estou preso numa parte de onde não consigo sair. Criei ou queria criar um slideshow mas este limita-se a enlotar as imagens e mais nada. Podem dar uma ajuda, ver onde tenho mal o código? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600' rel='stylesheet' type='text/css'> <link href="css/style.css" rel="stylesheet" type="text/css" media="all" /> <link rel="stylesheet" href="css/lightbox.css"> <!-- jquery plguin --> <title>Carousel</title> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> <script> $(function(){ $(".start-slide").click(function(){ $("#carousel-example-generic").carousel('cycle'); }); $(".pause-slide").click(function(){ $("#carousel-example-generic").carousel('pause'); }); $(".prev-slide").click(function(){ $("#carousel-example-generic").carousel('prev'); }); $(".next-slide").click(function(){ $("#carousel-example-generic").carousel('next'); }); $(".slide-one").click(function(){ $("#carousel-example-generic").carousel(0); }); $(".slide-two").click(function(){ $("#carousel-example-generic").carousel(1); }); $(".slide-three").click(function(){ $("#carousel-example-generic").carousel(2); }); }); </script> <script type="text/javascript"> var image_array = ['images/DESTAQUE_Vigar.jpg', 'images/DESTAQUE_Herma.jpg', 'images/DESTAQUE_Primo.jpg', 'images/DESTAQUE_Easy Dò.jpg', 'images/DESTAQUE_Acryl.jpg']; function load_img(imgId, image, images, index) { image.onerror = function() { load_img(imgId, this, images, index+1); }; image.onload = function() { var element = document.getElementById(imgId); if (element) { element.src = this.src; element.style.display = 'block'; } }; image.src = images[index]; } </script> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> </ol> <div class="carousel-inner"> <div class="item active"> <img src="images/" alt="#"> <div class="carousel-caption"> </div> </div> <div class="item"> <img src="images/" alt="#"> <div class="carousel-caption"> </div> </div> <div class="item"> <img src="images/" alt="#"> <div class="carousel-caption"> </div> </div> </div> <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#carousel-example-generic" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> Obrigado em avanço 👍 Link to comment Share on other sites More sharing options...
fteixeira1993 Posted February 11, 2016 at 03:43 PM Report Share #593350 Posted February 11, 2016 at 03:43 PM Boa Tarde, Uma vez que estas a utilizar o bootstrap dá uma vista de olhos nos exemplos que eles têm no site. Têm 1 exemplo com carrousel. O jquery tem que ser colocado antes de fechares da tag do body. Espero ter ajudado. cumps, fteixeira1993 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now