开发者

Invalid Argument in jQuery.js at line 116 !

This is my script to get color tag ! Which works in开发者_如何转开发 Firefox but in IE shows error.

<code>

document.documentElement.className += 'js_active';
jQuery.noConflict();

jQuery(document).ready(function(){

  jQuery(".color_tag_cloud a").each(function(){
  var links = jQuery(this).attr("href");
   jQuery(this).removeAttr("title");
   jQuery(this).attr("title",jQuery(this).text());

    if(links.indexOf("?")!=-1){
    var query =links.split("=")[1];
    var str = "#".concat(query);
     jQuery(this).css("background",str);
    }else{
    var color = links.split("colors/")[1];
    var query = color.split("/")[0];
    var str = "#".concat(query);
    jQuery(this).css("background",str);
    }
  });

 jQuery(".color_tag_cloud a").hover( function() {
   jQuery(this).stop().animate({"opacity": "0.2"}, "slow");
    },function() {
   jQuery(this).stop().animate({"opacity": "1"}, "slow");
 });
});

and my html is look like this.

<code><div class="color_tag_cloud">
<a href="http://www.freecssshowcase.com/colors/e30074/">PINK</a>
.......
</div>

</code>


Your script is setting some invalid hex color codes with the jQuery's css method, and IE is complaining about this.

Log the values of your str variable, and you will see:

Invalid Argument in jQuery.js at line 116 !

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜