Hi, I have 2 little questions:

1. In a piece of code I wrote:


      $div = $('<div class="elementContainer"></
div>').appendTo($container);
      $a = $('<a></a>').appendTo($div);
      $a.css({'background-image':'url("'+img.url+'");'})
      $a.addClass('element');
      $a.attr({'rel':img.basename});

To create a thumbnail image gallery. In firefox works well, in IE and
Safari I got an error in a jquery line.
If I change this 2 lines:

      $a = $('<a></a>').appendTo($div);
      $a.css({'background-image':'url("'+img.url+'");'})

In :

      $a = $('<a style="background-image:url(\''+img.url+'\');"></
a>').appendTo($div);

Works well.  Why?

2. In another piece of code, I used:

  $('input:checkbox').css({'width':'20px !important'});
  $('input:radio').css({'width':'20px !important'});

Cause in the css I have a rule tha says:
input { width:300px }
an make my radio and checkbox button large.

The problem is that those rules causes an error in IE (Argument not
valid in line 1120 jquery-1.2.6.js):

And these lines in the jquery uncopressed are highlighted.
                if ( set )
                        elem[ name ] = value;


I can solve the problem deleting the css rule and use $
('input:text').css({'width':'300px'}), but what's the reason of the
error?

Thank you, bye

Reply via email to