I want to load images into a div on my html but it doesn't work, if i change the var image = $("#slider") to $("body") it works, but then the whole body fades in and out and thats not what i wanted.
i guess there is something wrong with the identifier?
$(document).ready(function(){
var count = 0;
var images = ["/mvc_tut/views/index/images/bg1.jpg","/mvc_tut/views/index/images/bg2.jpg","/mvc_tut/views/index/images/bg3.jpg","/mvc_tut/views/index/images/bg4.jpg"];
var image = $("body");
image.css("background-image","url("+images[0]+")");
setInterval(function(){
image.fadeOut(1000, function(){
image.css("background-image","url("+images[count++]+")");
image.fadeIn(1000);
});
if(count == images.length)
{
count=0;
}
},3000);
});
thats the html
<div class="container">
<div id="#slider">
<div class="row">
<div class="col-md-6 homeleft">
</div>
<div class="col-md-3 col-md-offset-2">
<div class="login">
<form action="index/login" method="POST">
<input type="text" class="form-control" name="userLogin" placeholder="Nutzername">
<input type="password" class="form-control" name="passwortLogin" placeholder="Passwort">
<button type="submit" class="btn btn-default">Anmelden</button>
</form>
</div>
<div class="register">
<form action="index/register" method="POST">
<input type="text" class="form-control" name="userReg" placeholder="Nutzername">
<input type="text" class="form-control" name="emailReg" placeholder="Email">
<input type="password" class="form-control" name="passwortReg" placeholder="Passwort">
<button type="sumbit" class="btn btn-default">Registrieren</button>
</form>
</div>
</div>
</div>
</div>
</div>