Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/446.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
Javascript 使用jquery定位和显示隐藏元素_Javascript_Jquery_Css - Fatal编程技术网

Javascript 使用jquery定位和显示隐藏元素

Javascript 使用jquery定位和显示隐藏元素,javascript,jquery,css,Javascript,Jquery,Css,试图实现类似于qtip的东西,但是使用了一个表来比较不同事物的特性,我遇到了一个问题,我想在鼠标悬停上显示隐藏的元素。任何帮助都将不胜感激 display.eq(index.css)(“top”、+event.PageY) 需要: display.eq(index.css)(“top”、+event.pageY)-注意小写字母“p”。看起来case有一个简单的问题。event.PageY应为event.PageY 我已经修复了这个问题,并在这里对您的代码进行了一些小的CSS更改:而不是event

试图实现类似于qtip的东西,但是使用了一个表来比较不同事物的特性,我遇到了一个问题,我想在鼠标悬停上显示隐藏的元素。任何帮助都将不胜感激

display.eq(index.css)(“top”、+event.PageY)

需要:


display.eq(index.css)(“top”、+event.pageY)-注意小写字母“p”。

看起来case有一个简单的问题。event.PageY应为event.PageY


我已经修复了这个问题,并在这里对您的代码进行了一些小的CSS更改:

而不是
event.pageY
,我尝试使用
$(this.position()。top
和50到position的偏移量就在链接的正下方。见下文

content.on('mouseenter',function(){ //Used .on instead of bind
    var index=content.index(this);
    if(index<0){
        stop();
    }
    else{
        content.eq(index).css("font-weight","bold");
        display.stop(true,true);
        display.eq(index).css("top",+ $(this).position().top + 50); //Changed
        display.eq(index).fadeIn('slow');
    }
}).on('mouseleave',function(){ //Used .on instead of bind
    var index=content.index(this);
    display.hide();
    content.css("font-weight","normal");
});    
content.on('mouseenter',function(){//Used.on代替bind
var指数=内容指数(本);

if(indexh)您希望如何定位隐藏的元素?同意这一点。
$(this).position().top
将使工具提示的位置更加一致。非常感谢,这是一个令人沮丧的疏忽。