Very simple code, there is no more nonsense.
Code:
Copy Code code as follows:
/**
* November 13, 2014
* Prompt Plugin
*/
(function ($) {
$.fn.tips = function (text) {
var divtipsstyle = "Position:absolute;" left:0; top:0; Background-color: #dceaf2; padding:3px; Border:solid 1px #6dbde4; Visibility:hidden; line-height:20px; ";
$ ("Body"). Append ("<div class= ' div-tips ' style= '" + Divtipsstyle + "' >" + text + "</div>");
var divtips = $ (". Div-tips");
Divtips.css ("Visibility", "visible");
var top = This.offset (). Top-divtips.height ()-8;
var left = This.offset (). Left;
Divtips.css ("Top", top);
Divtips.css ("left", left);
$ (document). MouseMove (function (e) {
var top = e.clienty + $ (window). scrolltop ()-Divtips.height ()-12;
var left = E.clientx;
Divtips.css ("Top", top);
Divtips.css ("left", left);
});
};
$.fn.removetips = function (text) {
$ (". Div-tips"). Remove ();
};
})($);
The effect chart (the mouse moves above the commodity, will display a square product detail box below):
Very practical, small partners to play under the freedom to integrate into their own projects