myblog/static/js/tooltip.js
2018-11-26 16:56:44 +08:00

66 lines
1.7 KiB
JavaScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
<09><><EFBFBD>ߣ<EFBFBD>Ҷ<EFBFBD><D2B6>ΰ<EFBFBD><CEB0><EFBFBD><EFBFBD><EFBFBD>䣺yhw2710@126.com,QQ:517025143
*/
$(function(){
$(".news_content p:odd").addClass("p03"); //<2F><><EFBFBD>л<EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽP03
//<2F><><EFBFBD><EABEAD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><E4BBAF>
$(".news_content p").hover(
function () {
$(this).addClass("p02"); //<2F><><EFBFBD><EABEAD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽP02
},
function () {
$(this).removeClass("p02"); //<2F><><EFBFBD><EFBFBD>뿪ʱ<EBBFAA>Ƴ<EFBFBD><C6B3><EFBFBD>ʽP02
}
)
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD>
$("a").focus(
function () {
$(this).blur(); //<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧȥ<CAA7><C8A5><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7>һ<EFBFBD><D2BB>
}
)
})
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾЧ<CABE><D0A7><EFBFBD><EFBFBD>
var sweetTitles = {
x : 10,
y : 20,
tipElements : "a",
init : function() {
$(this.tipElements).mouseover(function(e){
this.myTitle = this.title;
this.myHref = this.href;
this.myHref = (this.myHref.length > 200 ? this.myHref.toString().substring(0,200)+"..." : this.myHref);
this.title = "";
var tooltip = "";
if(this.myTitle == "")
{
tooltip = "";
}
else
{
tooltip = "<div id='tooltip'><p>"+this.myTitle+"</p></div>";
}
$('body').append(tooltip);
$('#tooltip')
.css({
"opacity":"1",
"top":(e.pageY+20)+"px",
"left":(e.pageX+10)+"px"
}).show('fast');
}).mouseout(function(){
this.title = this.myTitle;
$('#tooltip').remove();
}).mousemove(function(e){
$('#tooltip')
.css({
"top":(e.pageY+20)+"px",
"left":(e.pageX+10)+"px"
});
});
}
};
$(function(){
sweetTitles.init();
});