TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Prakash Mondal
NA
288
211.5k
How to autorotate image like a slider inonly javascript,CSS?
Mar 30 2014 1:55 PM
How to autorotate image like a slider in only javascript and CSS without using JQuery???
I try this code... But doesn't work...
<html>
<head>
<title> Auto Change Background Color </title>
<style type="text/css">
div
{
height:320px;
width:100%;
}
</style>
<script type = "text/javascript">
var image = new Array ('pic-1.jpg', 'pic-2.jpg', 'pic-3.jpg', 'pic-10.jpg','pic-11.jpg');
var image_index = 0;
function ChangeBgImage ()
{
alert(image[image_index]);
document.getElementById("ddiv").style.backgroundImage="url(image[image_index])";
image_index++;
if (image.length == image_index)
{
image_index = 0;
}
}
setInterval( "ChangeBgImage()", 1000);
</script>
</head>
<body>
<div id="ddiv">
</div>
</body>
</html>
Please help me..............
Reply
Answers (
0
)
How to crate custom skin for DNN(DotNet Nuke)???????
How to disable save web page from visitor?