点击帮助按钮改变鼠标形状

$(function () {
$('html *:not(#btn_helper_)').click(function (e) {
hepler = false;
$("html").css({ cursor: "url(''),auto" });
//e.stopPropagation();
});
$("#btn_helper_").click(function (e) {
$("html").css({ cursor: "url('images/bangzhu.cur'),auto" });
hepler = true;
e.stopPropagation();
});});

$(".submenu a").hover(function () {
if (hepler == true)
$(this).css({ cursor: "url('images/bangzhu.cur'),auto" });
else {
$(this).css({ cursor:"pointer" });
}});

 

$(".submenu a").click(function () {
if (hepler == false) {
$("img", $(".action").parent()).each(function(i, o) {
var o = $(o);
var url = $(o).attr("src");
url = url.replace("c.png", ".png");
$(o).attr("src", url);
});
$('.submenu a').removeClass('action');
$(this).addClass('action');
var img = $("img", $(this).parent()).eq(0);
var url = img.attr("src");
//用于修复图片消失 由于操作过程如果浏览器先触发hover会加上c.png点click后.png会被替换为c.png最终变成cc.png而使得图标不存在而消失
if (url.indexOf("c.png") < 0)
url = url.replace(".png", "c.png");
img.attr("src", url);
} else {
//得到菜单id之后要根据这个id得到相应的帮助说明不要删了
//alert("hehe "+$(this).parent().attr("onClick").split(',')[2]);
var content;
var t = $(this).find("span").html();
var menuId = "";
try {
menuId = parseInt($(this).parent().attr("onClick").split(',')[2].replace("'", ""));
} catch(e) {
menuId = $(this).parent().attr("menuid");
}
$.post("index2.aspx?_method=getMenuContent", { menuId: menuId }, function (data) {
content = data;
$("#MenuComment").html(content);
$("#MenuComment").show();
$('#MenuComment').window({
title: t,
width: 820,
height: 500,
modal: true,
closable: true,
minimizable: false,
maximizable: true,
collapsible: true
});
});
$("html").css({ cursor: "url(''),auto" });
hepler = false;
}

});

转载于:https://www.cnblogs.com/kexb/p/4815295.html

你可能感兴趣的:(点击帮助按钮改变鼠标形状)