Hi,

I noticed that the "css" method clones the node including the id which is
supposed to be unique in the HTML document. I know the clone node is just
temporary but for cross browser and future compatibility, would it be good
to remove the "id" attribute from the clone node?

I tried removeAttr("id") but removeAttr doesn't return jQuery (why?), so I
used attr("id","") in the call chain but I would prefer to use removeAttr...

What do you guys think? Should this change be made to jQuery?


 css: function(e,p) {
  if ( p == "height" || p == "width" ) {
   var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];

   jQuery.each( d, function(){
    old["padding" + this] = 0;
    old["border" + this + "Width"] = 0;
   });

   jQuery.swap( e, old, function() {
    if (jQuery.css(e,"display") != "none") {
     oHeight = e.offsetHeight;
     oWidth = e.offsetWidth;
    } else {
      // FJ added .attr("id","") to avoid duplicate ids
     e = jQuery(e.cloneNode(true))
      .find(":radio").removeAttr("checked").end()
      .attr("id","") */* <<<--- Change made */*
      .css({
       visibility: "hidden", position: "absolute", display: "block", right:
"0", left: "0"
      }).appendTo(e.parentNode)[0];

Thanks

Fred

Reply via email to