Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.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图像大小转换onMouseOver_Jquery_Css_Image_Css Transitions - Fatal编程技术网

jquery图像大小转换onMouseOver

jquery图像大小转换onMouseOver,jquery,css,image,css-transitions,Jquery,Css,Image,Css Transitions,只是想知道是否有jquery插件,当你的鼠标在一个图像上时,这个图像的大小会增加,如果你的鼠标离开了图像,它的大小会减小,所有这些都是一个平滑的过渡。 谢谢 你可以试试,也可以根据自己的喜好进行翻滚。就我个人而言,我会选择教程路线,因为它会让你对结果有更多的控制权(你会学到一些引导的东西;)如果你只需要一个图像,你可以使用jQuery的UI效果。注意,这与基本jQuery是分开的-将其添加到jQuery调用下面 <script src="http://ajax.googleapis.com

只是想知道是否有jquery插件,当你的鼠标在一个图像上时,这个图像的大小会增加,如果你的鼠标离开了图像,它的大小会减小,所有这些都是一个平滑的过渡。
谢谢

你可以试试,也可以根据自己的喜好进行翻滚。就我个人而言,我会选择教程路线,因为它会让你对结果有更多的控制权(你会学到一些引导的东西;)

如果你只需要一个图像,你可以使用jQuery的UI效果。注意,这与基本jQuery是分开的-将其添加到jQuery调用下面

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
html:


只要记住,当你放大某个东西时,你需要弄清楚如何缩小,因为新的尺寸将是100%。在我的代码中,我们将其加倍(200%),然后将其减少一半(50%)以恢复到原始状态。您可以自由地使用过渡时间,以及您可能需要的任何回调来实现完美过渡


链接到和

有一个jQuery黑客:

$(document).ready(function() {
    $('#target_selector').mouseover(function(){
        $(this).css('height':'value', 'width':'value')
        $(this).mouseout(function(){
            $('this').css('height':'value', 'width':'value')
        });
    });
});
但是您可以使用CSS伪类:hover

#target_selector {
    height: value;
    width: value;
}
#target_selector:hover {
    height: value;
    width: value;
}
这两种方法都可以应用于此示例HTML

<html>

<body>

    <img id="target_selector" />

</body>

</html>

试试这个,下面是一个演示。我想这正是你需要的。
#target_selector {
    height: value;
    width: value;
}
#target_selector:hover {
    height: value;
    width: value;
}
<html>

<body>

    <img id="target_selector" />

</body>

</html>