]> source.dussan.org Git - jquery-ui.git/commitdiff
Image cropper demo: fixs #3092
authorChi Cheng <cloudream@gmail.com>
Thu, 7 Aug 2008 18:39:16 +0000 (18:39 +0000)
committerChi Cheng <cloudream@gmail.com>
Thu, 7 Aug 2008 18:39:16 +0000 (18:39 +0000)
demos/real-world/image-cropper/index.html

index 3fff4f5ea6ff6b8c0d91696f091ff38df856dd15..f532f887fcd4bc9be10d46760fc53ba11da60138 100644 (file)
                resize: function(e, ui) {
                        var self = $(this).data("resizable");
                        
-                 this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px';
+                       this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px';
                        
 
-                 $("#log-top").html(self.position.top+"px");
+                       $("#log-top").html(self.position.top+"px");
+                       $("#log-left").html(self.position.left+"px");
 
-                 $("#log-left").html(self.position.left+"px");
-
-                 $("#log-height").html(self.size.height+"px");
-
-                 $("#log-width").html(self.size.width+"px");
+                       $("#log-height").html(self.size.height+"px");
+                       $("#log-width").html(self.size.width+"px");
 
            },
                stop: function(e, ui) {
                        var self = $(this).data("resizable");
-                 this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px';
+                       this.style.backgroundPosition = (self.position.left * -1) + 'px ' + (self.position.top * -1) + 'px';
            }
        })
 
 
                drag: function(e, ui) {
                        var self = $(this).data("draggable");
-                       this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px';
-
-                 $("#log-top").html(self.position.top+"px");
-
-                 $("#log-left").html(self.position.left+"px");
+                       this.style.backgroundPosition = (self.position.left * -1) + 'px ' + (self.position.top * -1) + 'px';
 
+                       $("#log-top").html(self.position.top+"px");
+                       $("#log-left").html(self.position.left+"px");
                }
 
        });