positioning bug found by @ct.js

positioning bug on relative|absolute
pull/16/head
peterd 9 years ago
parent 1ac6303474
commit 77762df0b9

@ -17,7 +17,7 @@
<body> <body>
<h1>Simple jQuery implementation</h1> <h1>Simple jQuery implementation</h1>
Calling the colorPicker on all inputs with the calssName 'color': <pre>$('input.color').colorPicker();</pre> Calling the colorPicker on all inputs with the calssName 'color': <pre>$('input.color').colorPicker();</pre>
<p> <p class="the-paragraph">
<input class="color" value="#B6BD79" /> <input class="color" value="#B6BD79" />
<input class="color" value="rgb(162, 63, 3)" /> <input class="color" value="rgb(162, 63, 3)" />
<input class="color" value="hsl(32, 95%, 23%)" /> <input class="color" value="hsl(32, 95%, 23%)" />

File diff suppressed because one or more lines are too long

@ -17,4 +17,7 @@ pre {
border: 1px solid #aaa; border: 1px solid #aaa;
border-radius: 3px; border-radius: 3px;
width: 140px; width: 140px;
}
.the-paragraph {
position: relative;
} }

@ -98,7 +98,7 @@
$(elm)[onOff]('focus.colorPicker', function(e) { $(elm)[onOff]('focus.colorPicker', function(e) {
var $input = $(this), var $input = $(this),
position = $input.position(), position = $input.offset(),
index = multiple ? $(that).index(this) : 0, index = multiple ? $(that).index(this) : 0,
colorPicker = colorPickers[index] || colorPicker = colorPickers[index] ||
(colorPickers[index] = createInstance(this, config)), (colorPickers[index] = createInstance(this, config)),

Loading…
Cancel
Save