***********************************jquery
input.prototype.initHelpTip = function(){
$(".helpTip img").mouseover(function(){
this.tip = layer.tips(($(this).next().html()==undefined?"暂无说明":$(this).next().html()), this, {guide:1 ,maxWidth:240,style: ['text-align:left;border:1px solid #FEF9F0; background-color:#FEF9F0; color:#333', '#FEF9F0']});
}).mouseout(function(){
layer.close(this.tip);
});
//鼠标经过事件 ,移动到被保人出提示
$(document).ready(function(){
$(".helpTip").mouseover(function(){
$(this).find(".helpTip")
this.tip = layer.tips(($(this).children().next().html()==undefined?"暂无说明":$(this).children().next().html()), this, {guide:1 ,maxWidth:240,style: ['text-align:left;border:1px solid #FEF9F0; background-color:#FEF9F0; color:#333', '#FEF9F0']});
}).mouseout(function(){
layer.close(this.tip);
});
});
};
*******************************第二种可以,点击的
input.prototype.initHelpTip = function(){
var tip = undefined;//临时变量 用于函数外调用
//鼠标经过事件
$(".helpTip").mouseover(function(){
tip = this;
this.tip = layer.tips(($(this).children().next().html()==undefined?"暂无说明":$(this).children().next().html()), this, {guide:1 ,maxWidth:240,style: ['text-align:left;border:1px solid #FEF9F0; background-color:#FEF9F0; color:#333', '#FEF9F0']});
});
//点击空白处事件
$(document).click(function(e){
var target = $(".helpTip");//激活区域
var tip_layer = $(".xubox_layer");//提示区域
//判断点击处是否不存在于目标区域中
if((!target.is(e.target) && target.has(e.target).length === 0)
&& (!tip_layer.is(e.target) && tip_layer.has(e.target).length === 0)){
layer.close(tip.tip);
}
});
};
**********************************jsp
<div class="defalut-model-title">提示搜索
<span class="helpTip">
什么是钱江搜索
<img src="${ctx }/sale/template/default/images/default-help.gif">
<span style="display: none;" >
要提示的信息是这儿
</span>
</span>
</div>
**************
鼠标经过(什么是钱江搜索)(img)的时候提示( 要提示的信息是这儿)