| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Jul 2005 Location: Florida
Posts: 233
![]() | JS/jQuery: set/retrieve background position Hello, I modified a previously written script which controlled dragging an HTML element on the screen with the mouse. I modified it to instead drag the background position, but change only the X value (horizontal axis). The problem is, every time I click the element to drag the background, it resets the x value back to 0. The reason is because the variable which pulls the x value pulling offsetLeft, to calculate the left positioning of the actual element, which happens to be 0. I have tried changing this to backgroundPositionX, but I get an error that backgroundPositionX is undefined. Shouldn't it be able to retrieve the backgroundPositionX that currently exists on the property? Here is what the relevant code looks like: Code: lastElemLeft = this.style.backgroundPositionX; ????: NamePros.com http://www.namepros.com/programming/508850-javascript-jquery-set-retrieve-background-position.html Thanks!
__________________ www.headlinercreative.com |
| |
| | THREAD STARTER #2 (permalink) |
| NamePros Regular Join Date: Jul 2005 Location: Florida
Posts: 233
![]() | Any help please??
__________________ www.headlinercreative.com |
| |