search
HomeWeb Front-endHTML Tutorial鼠标经过图片放大,离开变回原形,在谷歌浏览器里面显示异常_html/css_WEB-ITnose

图片是放在easyui datagrid列里面的,我写的是当鼠标经过图片放大离开变回原形

代码是这样的:
鼠标经过图片放大,离开变回原形,在谷歌浏览器里面显示异常_html/css_WEB-ITnose
鼠标经过
a:hover img[class=imgView]{
position:absolute;
     -webkit-transform: scale(5);
     -ms-transform: scale(5);  
     transform: scale(5);
     transition: all 1s ease 0s;
     -webkit-transform: scale(5);
     -ms-transform: scale(5);  
     transform: scale(5);
     -webkit-transform: all 1s ease 0s;
     -ms-transform: all 1s ease 0s;   
      transform: all 1s ease 0s;
     z-index:10;
}
.imgView{
height:40px;
width:53px;
padding:2px;
}
在谷歌浏览器里面,鼠标经过时有时会一直闪有时又显示正常,大家知道是怎么回事吗


回复讨论(解决方案)

我最近也遇到过这个问题,我是通过改变文档结果来解决的。但这个问题的原理和出现的原因我不是太明白,我给你说下我的总结吧:
1.在css里面把过度效果删除,就不会出现闪烁的状况;
2.一个页面有多个这种过度效果,第一个过度效果没问题,后面的过度效果都会出现闪烁效果;
3.F12检查在过度的时候,闪烁的那个元素css样式并没有改变。
(ps:这是我出现的问题)
所以根据上面的情况我就觉得是文档结构出问题了,闪烁的元素可能被覆盖了,所以我就改了文档结构。

感觉你的问题和我挺像的,这个挺麻烦的,好好检查一下吧。

f12怎么检查过度效果啊,是这样改吗
a:hover img[class=imgView]{
     position:absolute;
     transform: scale(5);
     transition: all 1s ease 0s;
     z-index:10;
}
还是会闪动啊

你这样改只是把过度的兼容性语句去掉,根本看不出上面变化。transform: scale(5); transition: all 1s ease 0s;这两句才是你的过度效果。我的意思是删除这个来检查,但矛盾的是你删除这个你的图片也不会有什么变化,所以也检查不了什么。
我的意思是你根据我的思路去想一想调试方法,或者是说改变一下你的方法。
你可以试一试直接改变图片高和宽来做,不要用 transform: scale(5);

可以改用js动画来实现。。。

你这样改只是把过度的兼容性语句去掉,根本看不出上面变化。transform: scale(5); transition: all 1s ease 0s;这两句才是你的过度效果。我的意思是删除这个来检查,但矛盾的是你删除这个你的图片也不会有什么变化,所以也检查不了什么。
我的意思是你根据我的思路去想一想调试方法,或者是说改变一下你的方法。
你可以试一试直接改变图片高和宽来做,不要用 transform: scale(5);


我直接设置了宽高还是不行,鼠标放在图片边缘就会一直闪

可以改用js动画来实现。。。


什么意思啊?在js里面设置css吗?效果一样的啊

可以改用js动画来实现。。。


谢谢,animate函数可以实现。

可以用JQuery来实现啊

     transition: all 1s ease 0s;应该写在a后而非 :hover事件之后 。 }

js设置一个延时展示或者延时隐藏比较好,另外easy ui 的datagrid不太适合这个...

很简单的写法如
img{overflow:hidden;transition:all 5s;}
img:hover{transform:scale(1.2)}
鼠标放上去图片就会慢慢变大,效果不错

     transition: all 1s ease 0s;应该写在a后而非 :hover事件之后 。 }


这样图片是不闪了,但是图片就不会慢慢放大了啊

js设置一个延时展示或者延时隐藏比较好,另外easy ui 的datagrid不太适合这个...


之前用jquery animate函数鼠标在多张图片之间来回晃几下,动画就停不下来了

很简单的写法如
img{overflow:hidden;transition:all 5s;}
img:hover{transform:scale(1.2)}
鼠标放上去图片就会慢慢变大,效果不错


360兼容模式下就成这样了
还有ie9以下是不支持其它元素伪类的


js设置一个延时展示或者延时隐藏比较好,另外easy ui 的datagrid不太适合这个...


之前用jquery animate函数鼠标在多张图片之间来回晃几下,动画就停不下来了

这么炫的效果,确实有点难度。。。。。。

http://www.kendoui.io/examples/grid/index.html

这个比较炫,你看下。、



js设置一个延时展示或者延时隐藏比较好,另外easy ui 的datagrid不太适合这个...


之前用jquery animate函数鼠标在多张图片之间来回晃几下,动画就停不下来了

这么炫的效果,确实有点难度。。。。。。

http://www.kendoui.io/examples/grid/index.html

这个比较炫,你看下。、

嗯嗯,谢谢。
我把transition:all 1s ease 0s写在img后面,基本上就可以正常使用了。



js设置一个延时展示或者延时隐藏比较好,另外easy ui 的datagrid不太适合这个...


之前用jquery animate函数鼠标在多张图片之间来回晃几下,动画就停不下来了

这么炫的效果,确实有点难度。。。。。。

http://www.kendoui.io/examples/grid/index.html

这个比较炫,你看下。、

嗯嗯,谢谢。
我把transition:all 1s ease 0s写在img后面,基本上就可以正常使用了。



js设置一个延时展示或者延时隐藏比较好,另外easy ui 的datagrid不太适合这个...


之前用jquery animate函数鼠标在多张图片之间来回晃几下,动画就停不下来了

这么炫的效果,确实有点难度。。。。。。

http://www.kendoui.io/examples/grid/index.html

这个比较炫,你看下。、

嗯嗯,谢谢。
我把transition:all 1s ease 0s写在img后面,基本上就可以正常使用了。
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML: Building the Structure of Web PagesHTML: Building the Structure of Web PagesApr 14, 2025 am 12:14 AM

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

From Text to Websites: The Power of HTMLFrom Text to Websites: The Power of HTMLApr 13, 2025 am 12:07 AM

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

Understanding HTML, CSS, and JavaScript: A Beginner's GuideUnderstanding HTML, CSS, and JavaScript: A Beginner's GuideApr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The Role of HTML: Structuring Web ContentThe Role of HTML: Structuring Web ContentApr 11, 2025 am 12:12 AM

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.

HTML and Code: A Closer Look at the TerminologyHTML and Code: A Closer Look at the TerminologyApr 10, 2025 am 09:28 AM

HTMLisaspecifictypeofcodefocusedonstructuringwebcontent,while"code"broadlyincludeslanguageslikeJavaScriptandPythonforfunctionality.1)HTMLdefineswebpagestructureusingtags.2)"Code"encompassesawiderrangeoflanguagesforlogicandinteract

HTML, CSS, and JavaScript: Essential Tools for Web DevelopersHTML, CSS, and JavaScript: Essential Tools for Web DevelopersApr 09, 2025 am 12:12 AM

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

The Roles of HTML, CSS, and JavaScript: Core ResponsibilitiesThe Roles of HTML, CSS, and JavaScript: Core ResponsibilitiesApr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment