]> source.dussan.org Git - jquery.git/commitdiff
Updating unit tests for offset
authorBrandon Aaron <brandon.aaron@gmail.com>
Thu, 15 May 2008 23:36:06 +0000 (23:36 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Thu, 15 May 2008 23:36:06 +0000 (23:36 +0000)
test/data/offset/fixed.html
test/data/offset/scroll.html
test/data/offset/static.html
test/data/offset/table.html

index 15855763bfc73a9ecfdef2c86f8106429c2ae9ed..8d69aae94d001d4f72b04363f21bd4164c10a06e 100644 (file)
@@ -28,5 +28,6 @@
                <div id="fixed-2" class="fixed"></div>
                <div id="forceScroll"></div>
                <div id="marker"></div>
+               <p class="instructions">Click the white box to move the marker to it.</p>
        </body>
 </html>
\ No newline at end of file
index d65e0b9af307ea5f945c0a7b4cede73e0a16d80d..494f6405814f4d149ace2f0a9b8f7dec0e9df244 100644 (file)
@@ -34,6 +34,6 @@
                </div>
                <div id="forceScroll"></div>
                <div id="marker"></div>
-               <p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
+               <p class="instructions">Click the white box to move the marker to it.</p>
        </body>
 </html>
\ No newline at end of file
index bce715ea00effc1fa855af4e363046fd76c886f4..10116af65bde55e4af8380c4944569cb4cc9d56d 100644 (file)
@@ -15,6 +15,8 @@
                        $(function() {
                                $('.static').click(function() {
                                        $('#marker').css( $(this).offset() );
+                                       var pos = $(this).position();
+                                       $(this).css({ position: 'absolute', top: pos.top, left: pos.left });
                                        return false;
                                });
                        });
index de4c728eb1bb89066ee608b8e996d059bf3591fc..5d15b903b6a8083cf344de422be2cc509860954f 100644 (file)
@@ -38,6 +38,6 @@
                        </tbody>
                </table>
                <div id="marker"></div>
-               <p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
+               <p class="instructions">Click the white box to move the marker to it.</p>
        </body>
 </html>
\ No newline at end of file