Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用jquery更改mousemove()容器的顶部位置_Jquery_Html_Containers_Mousemove - Fatal编程技术网

使用jquery更改mousemove()容器的顶部位置

使用jquery更改mousemove()容器的顶部位置,jquery,html,containers,mousemove,Jquery,Html,Containers,Mousemove,请任何人告诉我如何更改此mousemove容器的y位置 container.find(".item_over").mousemove(function(e) { var offset = container.offset(); x = e.pageX - offset.left; var currentZone = Math.floor(x / zoneWidth); $(this).find("li").css("display

请任何人告诉我如何更改此mousemove容器的y位置

container.find(".item_over").mousemove(function(e) { 
        var offset = container.offset();
        x = e.pageX - offset.left;
        var currentZone = Math.floor(x / zoneWidth);
        $(this).find("li").css("display", "none"); 
        $(this).find("li:eq(" + currentZone + ")").css("display", "block"); 
    }); 

谢谢大家

你们喜欢做什么?在鼠标光标后垂直移动容器?
container.find(".item_over").mousemove(function(e) { 
    var offset = container.offset(),  //comma to seperate variables
        x = e.pageX - offset.left, 
        y = e.pageY - offset.top, //gets Y, not sure how you intend to use it ??
        currentZone = Math.floor(x / zoneWidth);

    $(this).find("li").css("display", "none"); 
    $(this).find("li:eq(" + currentZone + ")").css("display", "block"); 
}); ​