jquery hover text plugin
var $el, $tempDiv, $tempButton, divHeight = 0;
$.fn.middleBoxButton = function(text, url) {
return this.hover(function(e) {
$el = $(this).css("border-color", "white");
divHeight = $el.height() + parseInt($el.css("padding-top")) + parseInt($el.css("padding-bottom"));
$tempDiv = $("<div />", {
"class": "overlay rounded"
});
$tempButton = $("<a />", {
"href": url,
"text": text,
"class": "widget-button rounded",
"css": {
"top": (divHeight / 2) - 7 + "px"
}
}).appendTo($tempDiv);
$tempDiv.appendTo($el);
}, function(e) {
$el = $(this).css("border-color", "#999");
$(".overlay").fadeOut("fast", function() {
$(this).remove();
})
});
}
$(function() {
$(".widget-one").middleBoxButton("room info", "rooms.html");
});
具体例子:http://www.oceanstar.sh.cn/cn/intro.html
来自:㊣箛楓思囡de qq:136346801 相关推荐
MaureenChen 2020-03-01
HSdiana 2019-12-27
lunareclipse 2019-12-23
Uching 2006-11-13
PHP基础学习 2019-01-15
dazhifu 2019-07-01
刁连通 2019-01-15
NARUTOLUOLUO 2016-07-11
vavid 2016-01-16
yaodilu 2019-06-27
sorryericsson 2014-11-18
realitycss 2014-07-24
AlisaClass 2014-05-05