user1902427 user1902427 - 21 days ago 9
CSS Question

js sliding images (carousel) goes invisible

I am trying to make a carousel (or sliding images, not sure how to call it) on my page 'http://www.donnaliartist.com/testpage.php'
but the images just go invisible and I have no idea why.

here's my html code

<div id="slideImg" class="row centered moveup img">
<div class="slideMain">
<ul class="slide1">
<li><img src="assets/img/donna-megan.jpg" width="1151px" hspace="15" class="img-responsive"></li>
<li><img src="assets/img/donna-charcoal.jpg" width="1151px" hspace="15" class="img-responsive"></li>
</ul>
</div>
</div>


js script

<script type="text/javascript">
$(document).ready(function(){
$("#slideImg").rotate({
speed:10,
width:"900px",
slide1:".slide1"
});
});
</script>


and my js scripts on the bottom of the page

<script src="assets/js/slides.min.jquery.js"></script>
<script src="assets/js/jquery.rotate.js"></script>

Answer

Looks like your code is rotating the element, e.g. 45 degrees. You want to alter the slide shown. There are numerous ways to do this. Personally, I like to do it with Bootstrap3, see the following

<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
width: 70%;
margin: auto;
}
</style>
</head>
<body>
<div class="container">
<br>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="a.jpg" alt="a" width="460" height="345">
</div>
<div class="item">
<img src="b.jpg" alt="b" width="460" height="345">
</div>
<div class="item">
<img src="c.jpg" alt="c" width="460" height="345">
</div>
<div class="item">
<img src="d.jpg" alt="d" width="460" height="345">
</div>
</div>
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</body>
</html>