|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Ok. Say I have a table, and I have set a background image to it.
I've also set the background-position: 20 30; HOW can I retrieve the positions through javascript..? So far, I've tried.. document.getElementById('name').style.backgroundPo sition '' '' .style.position '' '' .style.posLeft etc.... I can't find any way to do this, is it even possible? I want to make it so if a button is click, or a key is pressed, the background-position of the background image in the table is changed. |
|
#2
|
|||
|
|||
|
It's all good. I found out how.
Code:
document.getElementById('name').style.backgroundPo sition = '0px 0px';
It just didnt seem to work when the background property was set to a table, so I changed the table to a DIV and it works just fine. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > background image position - how to change it |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|