Javascript 如何使悬停效果改变另一个“悬停效果”;“对象”;挑选出来的
例如,我有两个类Javascript 如何使悬停效果改变另一个“悬停效果”;“对象”;挑选出来的,javascript,jquery,css,jqgrid,Javascript,Jquery,Css,Jqgrid,例如,我有两个类A和B,当我将鼠标悬停在数量、颜色等变化上时,我需要这两个类。B.我不知道是否可以使用CSS和onmouseover 我正在放一段代码来处理表的创建和类C的定义。 这里我需要的是,当用户delecione或将鼠标悬停在表上时,激活此类C jQuery(grid_selector).jqGrid({ url:urllst, datatype: 'json', height: 'auto',, ignoreCase: true,
A
和B
,当我将鼠标悬停在数量、颜色等变化上时,我需要这两个类。B.我不知道是否可以使用CSS和onmouseover
我正在放一段代码来处理表的创建和类C
的定义。
这里我需要的是,当用户delecione或将鼠标悬停在表上时,激活此类C
jQuery(grid_selector).jqGrid({
url:urllst,
datatype: 'json',
height: 'auto',,
ignoreCase: true,
colNames:['UF','NAME','CITY' ],
colModel:[
{name:"uf",index:"uf", width:100, sorttype:'text', viewable: true, frozen: true, focus: true,
stype:'text',
formoptions:{elmprefix:'*', label: 'UF:', rowpos:1, colpos:1},
editable:true,
editrules: {required: true},
edittype: 'custom',
classes: 'c',
editoptions: {style: "text-transform: uppercase",
'custom_element' : macro_uf_element,
'custom_value' : macro_uf_value,
},
我相信你需要使用javascript,但我可能错了
//grab all of the item images and make sure their popup description shows
var $contentWrapper = $("#contentWrapper");
//and bind the events that allow us to have a popup window follow the cursor
$contentWrapper.on("mouseover", className, function(event) {
var $itemDescription = $(this).parent("").find(".description");
//when the users cursor enters the item ensure that it enables vision of the popup and initialize the coordinates
updatePosition(event.clientX, event.clientY, $itemDescription);
$itemDescription.show();
});
这是我用来在用户将鼠标悬停在图像上时显示div的一段代码,我相信这与您要查找的内容类似。Hy伙计们,我的解决方法如下。 我声明了函数
mouseenter
和mouseleave
,因为只有hover
正在设置颜色,并且没有恢复正常。
将鼠标放在表格上时,将在classC
中进行行选择
$("#tabDados").mouseenter(function(){
$(".c").css("background-color","#eff3f8");
});
$("#tabDados").mouseleave(function(){
$(".c").css("background-color","#fff");
});
没有人,它不起作用,我也尝试了.blue{background color:blue;}$('a').hover(function(){$('b').toggleClass('blue'));//例如,当A没有悬停时,更改B中的文本颜色,但也不起作用,无论如何,谢谢你的帮助!你能提供你的代码吗?我会尽力帮助你。我可以向你保证,上面的代码是有效的,因为我正在使用它。hehe
hover
允许两次回调。你也可以执行$(“#tabDados”).hover(callback1,callback2)
第一个回调是mouseenter,第二个回调是mouseleave。