0

IE6 and 7 return a js error "expected identifier, string or number" on this :

function fadeopacity (){

  var opacity = $("#pics_list > li:first").css("opacity");

  $("#pics_list > li").hover( 

     function () {

          $(this).stop().animate({
        opacity: 1,
       }, 300, null)},
                             ->this is the line with an error? 
     function () {

      $(this).stop().animate({
       opacity: opacity,
      }, 200, null)}

  ) 
 }

which blocks all the page's scripts, this doesn't happen in IE8, and of course in every other browser out there

Sandro Antonucci
  • 1,683
  • 5
  • 29
  • 59

1 Answers1

2

I believe you're getting errors on these lines:

opacity: 1,
//and...
opacity: opacity,

Trailing commas tend to make IE angry :)

When you put the first on a single line it gets more apparent, like this:

.animate({ opacity: 1, }, 300, null)

Just remove the trailing comma in each place and see if you get any complaints then.

Nick Craver
  • 623,446
  • 136
  • 1,297
  • 1,155
  • since we're here, do you know how to reset back the original opacity in IE? that doesn't work in IE, plus on mouseover the images change opacity correctly but it starts from black?? – Sandro Antonucci Aug 16 '10 at 19:20
  • @Sandro - You can use `opacity: "toggle"` instead :) – Nick Craver Aug 16 '10 at 19:21
  • @Sandro - It sounds like you're probably experiencing is the IE alpha filter/cleartype bug, take a look at this question for details: http://stackoverflow.com/questions/457929/jquery-toggle-function-rendering-weird-text-in-ie-losing-cleartype – Nick Craver Aug 16 '10 at 20:23
  • maybe it is but I had to set opacity manually since IE is not reading .css("opacity") and the first time on mouseover it still fades from black, then it works ok. why? – Sandro Antonucci Aug 16 '10 at 21:02