WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > PROGRAMMING LANGUAGES > Scripting and Server Side > setAttribute to change background position

Reply
  Thread Tools Display Modes
Old 14th February 12, 01:43 PM   #1
Christian
WLC Member
 
Join Date: May 2010
Location: Warwick, UK
Posts: 7
Default setAttribute to change background position

function showT(q){
document.getElementById('image').setAttirbute('src ','0'+q+'.png)

amouseover="showT(1)"

changes the image of an element, but is there anyway of changing the background position (so that all images can be downloaded as a sprite)

Any help much appreciated.
Christian is offline   Reply With Quote
Old 14th February 12, 08:20 PM   #2
chrishirst
Banned
 
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
Default Re: setAttribute to change background position

You change the style properties in the same function.
chrishirst is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:21 AM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyrightę 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.