Javascript Image Slider / Posts /

jQuery Slider This code is not working properly Any one can guide me how I can solve it ?

8
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title> jQuery Slider </title>
 
<style type="text/css">
.slider{  
width:800px;
height:350px;
overflow:hidden;
margin:30px auto;
background-image:url(img/6.gif);
background-repeat:no-repeat;
background-position:center;
}
.shadow{
background-image: url(img/hello);
background-repeat:no-repeat;
background-position:top;
width:864px;
height:100px;
margin:-100px auto;
}
.slider img{
width:800px;
height:350px;
display:none;
}
</style>
 <script type="text/javascript"  src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

 <script type="text/javascript"        src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>

<script type="text/javascript">
function slider(){
$(".slider#1").show("fade",500);
$(".slider#3").delay(5500). hide("slide",{direction:'left'},500); 
var sc = $(".sliderimg").size();
var count = 2;
setInterval(function(){
$(".slider#" count).show("slide",{direction:"right"},500); 
$(".slider#" count).delay(5500). hide("slide",{direction:"left"},500);
if(count==sc){
count = 1;
}else{
count = count 1;
}
},6500);
}
</script>
</head>

<body onload="slider();">

<div class="slider">
<img id="1" src="img/hello.jpg" border="0" alt="hello" />
<img id="2" src="img/sir.jpg" border="0" alt="sir" />
<img id="3" src="img/dictator.jpg" border="0" alt="dictator" />
</div>
<div class="shadow"></div>
</body>

</html>
Mahtab  10 years ago   viewed: 8542    

2 Answers

1
This is not Menucool jQuery Slider.
Taylor   10 years ago
0
Try this ...
$(document).ready(function () {
    slider();
});

function slider(){
    var count = 1;
   
    $('#1').show();
   
    (function slide(){
        $('.slider img').hide();
       
        if (count > 3) {count = 1;} // makes this a loop
       
        $('#'+count).fadeIn('slow');
        count += 1;
       
        setTimeout(function () {
            slide();
        }, 5000);
    })();
}   
</script>
Akram
  9 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: