View Single Post
Old 09-17-2012, 05:43 PM   PM User | #8
blaze4218
Regular Coder

 
Join Date: Apr 2005
Location: Texas
Posts: 448
Thanks: 24
Thanked 63 Times in 63 Posts
blaze4218 is an unknown quantity at this point
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...
__________________
Allwisend bin ich nicht, doch viel ist mir bewursst
-Goethe
blaze4218 is offline   Reply With Quote