鼠标停在图片上变成小手怎么实现
学习前端的同学你们知道怎么使鼠标停在图片上变成小手吗?下面是小编收集整理关于鼠标停在图片上变成小手的资料以供大家参考学习,希望大家喜欢。
鼠标停在图片上变成小手的代码
加个样式就ok了
style=“cursor:cursor:pointer”
dwr 写的js
<script type="text/javascript">
<!--
var bikelistCache = { };
function findMnotes(mId,pId,uId,n, callbck)
{
MnoteAction.getMnoteList2(mId,pId,uId,
function (list)
{
/*
dwr.util.removeAllRows("tablebody"+n, { filter:function(tr)
{
// alert(tr.id);
return (tr.id != "template"+n);
}
}
);
*/
var mnote, id;
//list.sort( function(p1, p2) { return p1.id < p2.id;} );//排序
//alert(DWRUtil.toDescriptiveString(list,'id'));
if(list!=null && list.length>0){
$("div"+n).style.display="none";
for (var i = 0; i < list.length; i++) {
mnote = list[i];
id = mnote.noteId;
//复制模板行,并加上后缀比如id变成id0, id1... type变成type0,type1, edit变成 edit0,edit1
dwr.util.cloneNode("template"+n, { idSuffix:id });
// dwr.util.setValue("tabid" + id, mnote.meetingId);
if(mnote.title.length1=null && mnote.title.length>12){
dwr.util.setValue("tabtype" + id, mnote.title.substring(0,12));
}else{
dwr.util.setValue("tabtype" + id, mnote.title);
}
//dwr.util.setValue("bid"+id,mnote.type);
//$("bid"+id).innerText=mnote.type;
$("tabtype"+id).title=mnote.title;
if(mnote.type==null || mnote.type==''){
$("tabtype"+id).innerHTML="<b>["+" "+"]</b>"+$("tabtype"+id).innerText;
}else{
$("tabtype"+id).innerHTML="<b>["+mnote.type+"]</b>"+$("tabtype"+id).innerText;
}
//alert($("tabtype"+id).innerText);
// dwr.util.setValue("tabbikeName" + id, mnote.phase);
// alert($("template"+n + id));
if(mnote.state==1){
$("imgState"+id).src="images/meeting/xts_OK.png";
$("imgState"+id).alt="已完成";
}
$("template"+n + id).style.display = "block"; //把被复制的行显示打开
bikelistCache[id]=mnote;
}
}else{
$("div"+n).style.display="block";
}
if(callbck)
callbck()
//alert(tablebody.innerHTML);
//alert(DWRUtil.toDescriptiveString(bikelistCache,'id')); //调试
}
)
}
function initTab()
{
//alert('<s:property value="#session.user.userId" />');
<% List list1=WafDataProxy.getDataItemListByDataId("meetingphase");
if(list1!=null && list1.size()>0){
for(int i=0;i<list1.size();i++){
DataItem d=(DataItem)list1.get(i);
d.getItemDescription();
d.getItemValue();
%>
findMnotes('<s:property value="meetingId" />','<%=d.getItemId() %>','<s:property value="#session.user.userId" />',<%=i%>);
<%
}
}%>
}
function save()
{
//if(mnoteForm20.title.value.length>18){
// alert('输入的内容太长!不能超过十八个字!');
// return;
//}
var mnote = {meetingId:null, title:null,userId:null, phase:null,type:null};
dwr.util.getValues(mnote);
// alert(DWRUtil.toDescriptiveString(bike,"id"));
// var sel = $("years_sel").value==""?null:$("years_sel").value;
if(mnote.title=='' || mnote.title==null){
alert('内容不能为空,请填写内容!');
return ;
}
dwr.engine.beginBatch();
MnoteAction.UpdateNote(mnote);
findMnotes('<s:property value="meetingId" />','meetingphase_701','<s:property value="#session.user.userId" />',0);
dwr.engine.endBatch();
document.getElementById("addTr").style.display="none";
}
function save1()
{
var mnote = {meetingId:null, title:null,userId:null, phase:null,type:null};
dwr.util.getValues(mnote);
mnote.phase=mnoteForm21.phase1.value;
mnote.title=mnoteForm21.title1.value;
mnote.type=mnoteForm21.type1.value;
if(mnote.title=='' || mnote.title==null){
alert('内容不能为空,请填写内容!');
return ;
}
// return;
// alert(DWRUtil.toDescriptiveString(bike,"id"));
// var sel = $("years_sel").value==""?null:$("years_sel").value;
dwr.engine.beginBatch();
MnoteAction.UpdateNote(mnote);
findMnotes('<s:property value="meetingId" />','meetingphase_702','<s:property value="#session.user.userId" />',1);
dwr.engine.endBatch();
document.getElementById("addTr1").style.display="none";
}
function save2()
{
var mnote = {meetingId:null, title:null,userId:null, phase:null,type:null};
dwr.util.getValues(mnote);
mnote.phase=mnoteForm22.phase2.value;
mnote.title=mnoteForm22.title2.value;
mnote.type=mnoteForm22.type2.value;
if(mnote.title=='' || mnote.title==null){
alert('内容不能为空,请填写内容!');
return ;
}
// return;
// alert(DWRUtil.toDescriptiveString(bike,"id"));
// var sel = $("years_sel").value==""?null:$("years_sel").value;
dwr.engine.beginBatch();
MnoteAction.UpdateNote(mnote);
findMnotes('<s:property value="meetingId" />','meetingphase_703','<s:property value="#session.user.userId" />',2);
dwr.engine.endBatch();
document.getElementById("addTr2").style.display="none";
}
function sss(){
findMnotes(mnote.meet, function()
{
alert("完成了");
}
);
}
function updateState(eleid)
{
var noteid =eleid.substring(8);
MnoteAction.updateMnoteStateById(noteid,function(flag){
if(flag){
if(($("imgState"+noteid).src.indexOf("images/meeting/xts_zt.png"))>=0){
$("imgState"+noteid).src="images/meeting/xts_OK.png";
$("imgState"+noteid).alt="已完成";
}else{
$("imgState"+noteid).src="images/meeting/xts_zt.png";
$("imgState"+noteid).alt="设置状态";
}
}
});
//alert(noteid);
}
function delMnote(eleid)
{
//var sel = $("years_sel").value==""?null:$("years_sel").value;
var noteid =eleid.substring(6); //delete01 delete02.. 前缀是6位
if(!confirm("您确认要删除此条信息吗!")){
return;
}
dwr.engine.beginBatch();
MnoteAction.deleteMnoteById(noteid);
dwr.util.removeAllOptions("template0"+noteid);
MnoteAction.getMnoteList2('<s:property value="meetingId" />','meetingphase_701','<s:property value="#session.user.userId" />',
function(list){
if(list.length>0){
}else{
$("div0").style.display="block";
}
}
);
dwr.engine.endBatch();
/*
divNode1=$("tablebody0");
alert(divNode1.innerHTML);
nnote=divNode1.children("template0"+noteid);
alert(nnote.length);
nnote.removeNode(true);
divNode1.removeChild(nnote);
if(divNode1.contains(nnote)){
alert(true);
}
divNode1.removeChild(nnote);
//urnode=mnoteForm20.getElementsByTagName("ul");
urnode=divNode1.getElementsByTagName("ul");
alert(urnode.length);
if(urnode.length<=2){
$("div0").style.display="block";
}else{
alert(urnode.length);
}
*/
}
function delMnote1(eleid)
{
//var sel = $("years_sel").value==""?null:$("years_sel").value;
var noteid =eleid.substring(6); //delete01 delete02.. 前缀是6位
if(!confirm("您确认要删除此条信息吗!")){
return;
}
dwr.engine.beginBatch();
MnoteAction.deleteMnoteById(noteid);
dwr.util.removeAllOptions("template1"+noteid);
MnoteAction.getMnoteList2('<s:property value="meetingId" />','meetingphase_702','<s:property value="#session.user.userId" />',
function(list){
if(list.length>0){
}else{
$("div1").style.display="block";
}
}
);
dwr.engine.endBatch();
}
function delMnote2(eleid)
{
//var sel = $("years_sel").value==""?null:$("years_sel").value;
var noteid =eleid.substring(6); //delete01 delete02.. 前缀是6位
if(!confirm("您确认要删除此条信息吗!")){
return;
}
dwr.engine.beginBatch();
MnoteAction.deleteMnoteById(noteid);
dwr.util.removeAllOptions("template2"+noteid);
MnoteAction.getMnoteList2('<s:property value="meetingId" />','meetingphase_703','<s:property value="#session.user.userId" />',
function(list){
if(list.length>0){
}else{
$("div2").style.display="block";
}
}
);
dwr.engine.endBatch();
// alert('删除成功!');
}
//-->
</script>