This control is developed based on Jquery. To reference the Jquery framework
control code
$.fn.myNudge = function() {
var self = $(this);
self.css({ position: "absolute" }); //Make this element absolutely positioned
var selfLeft = self.css("left");
var selfTop = self.css("top");
self.css({ left: selfLeft, top: selfTop }); //Set This element is the original position
self.hover(function() {
self.animate({ left: " =50px" }, 1000);
},
function() {
self.animate({ left: "-=50px" }, 1000);
}
);
}
Usage
HTML code
sadfsadfds
JAVASCRIPT code
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn