javascript - 如何使悬停效果改变另一个选择的 "object"

标签 javascript jquery css jqgrid

例如,我有两个类 AB,当我将鼠标悬停在数量、颜色等变化上时,我需要它。 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 的一小段代码,我相信这与您正在寻找的类似。

关于javascript - 如何使悬停效果改变另一个选择的 "object",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24562063/

相关文章:

javascript - 主干js : the collection initialize in view module have only one model

javascript - 如何排序列表首先开始然后包含 md-autocomplete AngularJS 中的字符串搜索

javascript - 通过input type = file获取字节数组

jquery - 多个不同的水平导航菜单底部边框颜色?

javascript - 需要在asp .net文本框中使用焦点

html - 在网页加载时使元素 100%

javascript - ChartJS 不绘制图表

javascript - 鼠标滚轮事件区别

css - 流体布局的 Div 定位

Javascript 图像翻转 - 需要标题,如何添加?