aboutsummaryrefslogtreecommitdiffstats
path: root/demos/position
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-08-26 18:21:15 -0400
committerScott González <scott.gonzalez@gmail.com>2012-08-26 18:21:15 -0400
commit7e9315a34dbe718075293a1e033d2988e24b4f71 (patch)
tree7e6f85abfb0f7f127b1bf4cbd4742877afdd5085 /demos/position
parente318e5b2248487561f8fdad736e630557cd44d09 (diff)
downloadjquery-ui-7e9315a34dbe718075293a1e033d2988e24b4f71.tar.gz
jquery-ui-7e9315a34dbe718075293a1e033d2988e24b4f71.zip
Position cycler demo: Cleanup.
Diffstat (limited to 'demos/position')
-rw-r--r--demos/position/cycler.html38
1 files changed, 12 insertions, 26 deletions
diff --git a/demos/position/cycler.html b/demos/position/cycler.html
index 0c9324781..16542b962 100644
--- a/demos/position/cycler.html
+++ b/demos/position/cycler.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
@@ -9,46 +9,32 @@
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.position.js"></script>
<link rel="stylesheet" href="../demos.css">
- <style>
- html, body {
- margin: 0;
- padding: 0
- }
- </style>
<script>
$(function() {
// TODO refactor into a widget and get rid of these plugin methods
- $.fn.position2 = function( options ) {
- return this.position( $.extend({
- of: window,
- using: function( to ) {
- $( this ).css({
- top: to.top,
- left: to.left
- })
- },
- collision: "none"
- }, options));
- }
-
$.fn.left = function( using ) {
- return this.position2({
+ return this.position({
my: "right middle",
at: "left+25 middle",
+ of: window,
+ collision: "none",
using: using
});
- }
+ };
$.fn.right = function( using ) {
- return this.position2({
+ return this.position({
my: "left middle",
at: "right-25 middle",
+ of: window,
+ collision: "none",
using: using
});
- }
+ };
$.fn.center = function( using ) {
- return this.position2({
+ return this.position({
my: "center middle",
at: "center middle",
+ of: window,
using: using
});
};
@@ -68,7 +54,7 @@
$( "img:eq(2)" ).right();
function animate( to ) {
- $(this).stop( true, false ).animate( to );
+ $( this ).stop( true, false ).animate( to );
}
function next( event ) {
event.preventDefault();