给你:
(function($){
$.fn.tips = function(){
return this.each(function(i){
var title = $(this).attr(\'title\'),
url = \'http://s.wordpress.com/mshots/v1/\' + encodeURIComponent($(this).attr(\'href\')) + \'?w=400\',
message = \'By clicking this you are leaving my website :(\',
webshot = $(\'<div><p>\' + message + \'</p><img src="\' + url + \'" width="400" alt="\' + title + \'" /></div>\').css({
position: \'absolute\',
left: -20000,
textAlign: \'center\',
color: \'#ffffff\',
backgroundColor: \'rgba(0,0,0, 0.4)\',
padding: 10,
zIndex: 40
}).hide().appendTo(document.body);
return $(this).mouseover(function(){
webshot.show();
}).mousemove(function(kmouse){
webshot.css({
left: kmouse.pageX + 15,
top: kmouse.pageY + 15
});
}).mouseout(function(){
webshot.hide();
});
});
};
})(jQuery);
jQuery(document).ready(function($){
// all links except the ones which reference starts with # or http://localhost
$(\'a:not([href^="http://localhost"], [href^="#"])\').tips();
});
(更改
localhost
使用您的网站地址)
Thumbnails 从wordpress检索。com公司
我最初是为主题内的ping列表制作的,所以如果您对所有链接都使用此选项,最好是在鼠标悬停时创建Webshot,而不是在文档加载后直接创建。。。