如何使悬停效果改变另一个“对象”选中
How to make a hover effect change another "object" selected
例如,我有两个类A
和B
,当我将鼠标悬停在数量,颜色等变化时,我需要它们。B.我不知道我是否可以使用CSS和onmouseover
。
我放了一段代码来处理表的创建和类C
的定义。我这里需要的是,当用户选择或悬停在表上时,激活这个类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,我相信这与您正在寻找的类似。
伙计们,我决定如下。我声明了mouseenter
和mouseleave
函数,因为只有hover
设置了颜色,而没有恢复正常。当您将鼠标放置在表上时,行选择将在类C
中发生。
$("#tabDados").mouseenter(function(){
$(".c").css("background-color","#eff3f8");
});
$("#tabDados").mouseleave(function(){
$(".c").css("background-color","#fff");
});
相关文章:
- angularjs 选中复选框时隐藏具有特定类的对象
- 选择一个从 mysql 返回选中/未选中复选框的对象
- 如何将所有复选框放入一个对象数组并标记选中的复选框
- 选中加载时对象数组中的复选框
- 选中复选框(如果 json 对象中存在)
- 将单选按钮绑定到复杂对象可防止选中
- 语法错误,无法识别的表达式:[对象 HTMLDivElement]输入:复选框[名称=]:选中
- Jquery-如何获取选中复选框的Jquery对象
- 选中复选框时更改父对象的背景
- 在AngularJS中,如何取消选中单选按钮以使所有对象变为false
- 搜索克隆选择对象的选项值,如果存在则设置选中
- 在Angular中,当一个选项被下拉菜单选中时,如何修改一个对象
- 尝试使用angular js将选中的选项赋给用户对象
- 如何使悬停效果改变另一个“对象”选中
- 对象在设置attr('checked');后检查复选框是否被选中时,在IE8中不支持此属性或方法
- 当点击多个正方形对象时,它们会被选中
- redux-form字段和复选框反应工具箱值从对象中选中
- 使用ng-repeat动态创建对象,希望默认选中复选框
- 如何用Javascript标记从对象中选中的下拉菜单
- Microsoft JScript运行时错误:无法获取属性'的值;选中':对象为null或仅在IE9中未