View Single Post
Old 09-17-2012, 05:46 PM   PM User | #9
krillezzz
New Coder

 
Join Date: Sep 2012
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
krillezzz is an unknown quantity at this point
Quote:
Originally Posted by blaze4218 View Post
You cannot access a className this way.
If you used an id instead
Code:
#content
{
	height: 600px;
	width: auto;
	padding: 0px;
	background-image: url("images/kontor-1.png");
	background-repeat: no-repeat;
	background-position: center;
}
Code:
document.getElementById('content').style.background = 'url(images/kontor-' + currentIndex + '.png)';
but as long as you are using jQuery, you would't have to switch to an id...
I'm very new to this like you probably already noticed, but i'm trying to use JQuery, but cant this to work =/
krillezzz is offline   Reply With Quote