Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.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 css span:hover不';不适用于IE,但适用于Firefox_Javascript_Css_Html - Fatal编程技术网

Javascript css span:hover不';不适用于IE,但适用于Firefox

Javascript css span:hover不';不适用于IE,但适用于Firefox,javascript,css,html,Javascript,Css,Html,这是我的jsp页面的基本结构 <div><span><span> </span</span></div> function showStopsInfoPopup(stop, index){ jQuery(function($) { $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop); }); } javascript

这是我的jsp页面的基本结构

<div><span><span>   </span</span></div>
function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
javascript

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}

因为CSS3和之前支持的伪选择器仅用于标记。这就是为什么标签也在IE上工作的原因。为了支持这一点,您应该为IE浏览器附加mouseover和mouseout事件,您可以通过hack和jquery轻松实现这一点

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
只是在JS和css中添加了一些简单的更改,应该就可以了

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
JS和hack仅适用于IE

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
}));

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
CSS

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}

因为CSS3和之前支持的伪选择器仅用于标记。这就是为什么标签也在IE上工作的原因。为了支持这一点,您应该为IE浏览器附加mouseover和mouseout事件,您可以通过hack和jquery轻松实现这一点

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
只是在JS和css中添加了一些简单的更改,应该就可以了

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
JS和hack仅适用于IE

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
}));

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
CSS

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}

我想这可以通过使用jQuery以更简单的方式完成,如下所示:

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
$(".content").on("mouseover", function(){
    $(this).find("span").show();
});

$(".content").on("mouseout", function(){
    $(this).find("span").hide();
});
HTML:

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}

你好

我想使用jQuery可以更轻松地完成这项工作,如下所示:

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
$(".content").on("mouseover", function(){
    $(this).find("span").show();
});

$(".content").on("mouseout", function(){
    $(this).find("span").hide();
});
HTML:

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}

你好

:在较旧的浏览器中,除了带有标记外,鼠标悬停不起作用。如果必须使用span标记,则需要同时添加span和a。这就是大多数菜单的工作原理

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
就你而言:

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
<div><a><span>default text <span>(hover text)</span></span></a></div>
此处演示:

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}

另一种选择是使用JavaScript而不是css。

:hover在旧浏览器中不起作用,除非带有标记。如果必须使用span标记,则需要同时添加span和a。这就是大多数菜单的工作原理

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
就你而言:

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}
<div><a><span>default text <span>(hover text)</span></span></a></div>
此处演示:

function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}

另一种选择是使用JavaScript而不是css。

尽可能避免使用内联事件处理程序。使用jQuery绑定它们并不难。谢谢。。我从未使用过jquery。你能给我举一个绑定的例子吗?尽可能避免内联事件处理程序。使用jQuery绑定它们并不难。谢谢。。我从未使用过jquery。你能给我举一个bind的例子吗?你能告诉我jquery的什么类型的攻击和什么特性吗?我以前很少使用jquery。你能告诉我jquery的什么类型的攻击和什么特性吗?谢谢。我以前几乎没有使用过jquery,但我会尝试一下。谢谢。我以前几乎没有使用过jquery,但我会尝试一下。
function showStopsInfoPopup(stop, index){
    jQuery(function($) {
        $("#stopsInfo"+index).load("showStopsInfoPopup.do?stop="+stop);
    }); 
}