Firefox和jQuery的问题 [英] Problems with Firefox and jQuery

查看:85
本文介绍了Firefox和jQuery的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此代码来更改div的大小和不透明度,并创建缩放效果":

i use this code for change the size and the opacity of div and create the "zoom-effect" :

$("#div5").click(function () {

                                        $('#wrap').animate({
                                            'opacity' : 0,
                                            'zoom': 1.08,

                                        },500);

                                            $('#wrap').hide(500,function(){ 

                                                    $('#dBenefits').show();

                                                    $('#dBenefits').animate({
                                                        'opacity' : +10,
                                                        'zoom': 1.08,

                                                    },500);

                                             });

                                        });



                                        $('#back').click(function (){

                                            $('#dBenefits').animate({
                                            'opacity' : 0,
                                            'zoom': 1,

                                        },500);

                                            $('#dBenefits').hide(500, function (){

                                                $('#wrap').show({'opacity' : 0,},500);

                                                $('#wrap').animate({
                                                    'opacity' : +10,
                                                    'zoom': 1,


                                                },500);

                                            });

为什么在Firefox上无法正常工作? 不会创建缩放效果,但会确实使div5消失并显示其他div,但效果不正确.

Why on Firefox don't work properly? does not create the zoom effect but it does disappear the div5 and appear other div but it does not properly.

Chrome在相同的代码上可获得更好的结果和我想要的结果.

While Chrome on the same code leads to a better result and the result I want.

没有控制台错误.

示例: http://jsfiddle.net/JshKH/

谢谢.

推荐答案

zoom是专有的CSS属性,在Firefox中不起作用. Webkit支持它,因此显然可以在Safari,Chrome和IE中使用,但不能在Firefox中使用. 站点引用

zoom is a proprietary css-property, it does not work in Firefox. Webkit supports it, so apparently it works in Safari, Chrome and IE but not in Firefox. sitepoint reference

有FF规则,例如

-moz-transform: scale(2);

但是我相信它需要正确的规则组合才能在所有浏览器中达到与zoom相同的效果.

but I believe it requires the correct combination of rules to achieve the equivalent to zoom across all browsers.

或者,您可以将zoom替换为,更改字体大小或粗细和/或填充.

Alternatively, you might replace zoom with perhaps, changes to the font-size or weight, and/or padding.

这篇关于Firefox和jQuery的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆