Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/398.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转换+;google chrome的z索引问题_Javascript_Css_Google Chrome_Webkit_Transform - Fatal编程技术网

javascript/css转换+;google chrome的z索引问题

javascript/css转换+;google chrome的z索引问题,javascript,css,google-chrome,webkit,transform,Javascript,Css,Google Chrome,Webkit,Transform,谷歌chrome、中央图像有一些问题,但它们没有 请尝试以下代码以重复此问题: <!DOCTYPE html> <html> <head> <script> function big_image(myelem) { myelem.style.webkitTransform = 'scale(2.0)'; myelem.style.zIndex = '99'; } function orig_image(myelem) { myelem.st

谷歌chrome、中央图像有一些问题,但它们没有

请尝试以下代码以重复此问题:

<!DOCTYPE html>
<html>
<head>

<script>

function big_image(myelem) {
myelem.style.webkitTransform = 'scale(2.0)';
myelem.style.zIndex = '99';
}


function orig_image(myelem) {
myelem.style.webkitTransform = 'scale(1.0)';
myelem.style.zIndex = 'auto';
}

</script>


</head>
<body>

<img src="http://www.pewforum.org/files/2015/10/PF_15.10.05_PostPapal_promo260x260.jpg" onmouseover="big_image(this);" onmouseout="orig_image(this);">

<img src="http://www.pewforum.org/files/2015/10/PF_15.10.05_PostPapal_promo260x260.jpg" onmouseover="big_image(this);" onmouseout="orig_image(this);">

<img src="http://www.pewforum.org/files/2015/10/PF_15.10.05_PostPapal_promo260x260.jpg" onmouseover="big_image(this);" onmouseout="orig_image(this);">

</body>
</html>

函数大图(myelem){
myelem.style.webkitttransform='scale(2.0)';
myelem.style.zIndex='99';
}
函数源图像(myelem){
myelem.style.webkitttransform='scale(1.0)';
myelem.style.zIndex='auto';
}
如何修复/克服它?
谢谢。

z索引和转换属性有一个bug

避免这种情况的最佳方法是重置转换属性onmouseout:

function big_image(myelem) {
    myelem.style.webkitTransform = 'scale(2.0)';
    myelem.style.zIndex = '2';
}


function orig_image(myelem) {
    myelem.style.webkitTransform = 'none';
    myelem.style.zIndex = '1';
}
在Chrome/Opera上测试并按预期工作