开发者

How can i use JQuery fadeTo() in IE 7?

I am using jquery fadeTo() its working in chrome and firefox but not in IE 7. Below code is not working in IE 7..

I have fixed ta开发者_运维知识库ble.nav td:have{ opacity:0.2;}

Run time i use jquery to change opacity 0.2 to 1.0

 $(document).ready(function() {  

          $("table.nav td").hover(function() {

              $("table.nav td:hover").fadeTo("slow", 1.0);



          });

      });


I guess this is how you want it to work?

$(function() {
    $("table.nav td")
        .css("opacity", "0.2") //Doing this in jQuery is better cross browser than just opacity in CSS
        .hover(function() {
            $(this).fadeTo("slow", 1.0);
        },function() {
            $(this).fadeTo("slow", 0.2);
        });
});​

Example: http://jsfiddle.net/wk74b/1/

That code works in IE7 for me.


I created a sample and it does work in IE 7. Check out demo here.

Agree with jAndy about opacity issue.

$(document).ready(function() { 

        $("#hello").fadeTo("slow", 0.2);

        $("#hello").hover(function() {

                              $("#hello").fadeTo("slow", 1);

                            }, 
                            function ()
                            {
                              $("#hello").fadeTo("slow", 0.2);

                            }
          );
      });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜