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
Blumonde
NA
78
28.7k
Background images not shown in MVC
May 4 2016 2:37 PM
Hello,
I placed the jquery script below in my layout.cshtml for it to display different background images but nothing happens. Please advise what am I missing. Thank you. Note: the paths of the images are correct.
<script>
$(document).ready(function(){
var header = $('body');
var backgrounds = new Array(
'url(~/Content/images/bgImage-1.jpg)'
, 'url(~/Content/images/bgImage-2.jpg)'
, 'url(~/Content/images/bgImage-3.jpg)'
, 'url(~/Content/images/bgImage-4.jpg)'
, 'url(~/Content/images/bgImage-5.jpg)'
);
var current = 0;
function nextBackground() {
current++;
current = current % backgrounds.length;
header.css('background-image', backgrounds[current]);
}
setInterval(nextBackground, 1000);
header.css('background-image', backgrounds[0]);
});
</script>
Reply
Answers (
4
)
using asp.net C# how to create subdomain like
How can I solve the "could not load file or assembly 'ADODB'