jQuery:如何平滑调整动画图像大小

发布于 2024-09-02 03:06:37 字数 782 浏览 1 评论 0原文

我是一个 jQuery 菜鸟 - 所以请原谅这个问题的可能基础性。

我正在做一些非常简单的事情 - 悬停时为图像的位置和大小设置动画。当你将鼠标悬停在图像上时,会出现一些明显的“锯齿”(在 FF、chrome、safari 和其他蹩脚的浏览器中) - 有没有办法摆脱这个问题? jquery 代码如下,实时链接位于 kristechdev.metropoliscreative.com(将鼠标悬停在图标上)。

<script type="text/javascript"> 

   $(document).ready(function() {

    $('#zoomNav li img').hoverIntent(

     function() {

      $(this).animate({'margin-top' :'-35px', 'margin-left' :'-10px', 'height' :'95px','width' : '79px' }, 
            'fast');
     }, 

     function() {

      $(this).animate({'margin-top' : '0px', 'margin-left' :'0px', 'height' :'70px','width' : '58px' }, 
            'fast');
    });    
   });



</script>

I'm a jQuery noob - so please excuse the probable basicness of this question.

I'm doing something pretty simple - on hover animate the position and size of an image. When you mouse over the images there are some noticeable 'jaggies' (in FF, chrome, safari and that other crappy browser) - is there a way to get rid of this? The jquery code is as follows and a live link is here kristechdev.metropoliscreative.com (hover over the icons).

<script type="text/javascript"> 

   $(document).ready(function() {

    $('#zoomNav li img').hoverIntent(

     function() {

      $(this).animate({'margin-top' :'-35px', 'margin-left' :'-10px', 'height' :'95px','width' : '79px' }, 
            'fast');
     }, 

     function() {

      $(this).animate({'margin-top' : '0px', 'margin-left' :'0px', 'height' :'70px','width' : '58px' }, 
            'fast');
    });    
   });



</script>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

还在原地等你 2024-09-09 03:06:37

可能需要在 IE 中启用图像插值 ,如果这就是问题所在。

Might need to enable interpolation on images inside IE, if that's where the issue is.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文