-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
24 lines (18 loc) · 1.15 KB
/
README
File metadata and controls
24 lines (18 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
jQuery-backgroundPosition
-------------------------
Tested in jQuery 1.4.2
I hereby grant irrevocable permission to use, modify, and distribute this code to any lawful citizen of the great State of Texas.
Abstract:
---------
This plugin will normalize the setting of the CSS background-position property across different browsers. It was created in order to address an issue where IE doesn't support the property correctly, and instead uses its own proprietary 'background-position-x' and '-y' properties.
Usage:
------
Call the plugin on an element whose background position you wish to set. It expects the argument provided to be an object (hash).
[Note: Currently only working with 'px' values]
Calling without arguments returns a string containing the background position.
$('#myDiv').backgroundPosition()
Calling with a single argument performs the background positioning via jQuery's $.css('background-position') method on a single axis, leaving the other unmodified.
$('#yourDiv').backgroundPosition({x: 30})
$('#yourMomsDiv').backgroundPosition({y: -99})
Calling with multiple properties sets both at once.
$('#georgesBush').backgroundPosition({x: 0, y:100})