salut tout le monde,
voila mon code, qui marche sous FF et non sous IE , je ne comprend pas pouequoi la variable 'hauteur' est egale a 0 sous IE
auriez vous une idée svp ?
Modifié par hakkou (04 Jun 2007 - 11:38)
if(enclosure)
{
type_image=enclosure.getAttribute('type');
url_image=enclosure.getAttribute('url');
At=type_image.indexOf('image');
var test_image=false;
if(At != -1)
{
div_image=Builder.node('img',{src:url_image,style:'float:left;margin:5px;'});
test_image=true;
}
}
else
{
if(site.indexOf('feedburner') == -1)
{
image_description= description.firstChild.nodeValue.indexOf("<img");
if(image_description != -1 )
{
image_description=description.firstChild.nodeValue.substring(image_description,description.firstChild.nodeValue.length);
image_description=image_description.substring(0,image_description.indexOf('>')+1);
cote=image_description.substring(image_description.indexOf('src='),image_description.indexOf('src=')+5);
cote=cote.substring(4,5);
lien_image=image_description.substring(image_description.indexOf('src='+cote)+5,image_description.length);
url_image=lien_image.substring(0,lien_image.indexOf(cote));
test_image=true;
[#red]div_image=Builder.node('img',{src:url_image,style:'float:left;margin:5px;'});[/#]
}
}
}
//plus=Builder.node('span',{id:'plus_'+(nbFlux).toString()+'_'+i,className:'le_plus'});
//plus.innerHTML='+';
resume=Builder.node('div',{id:'p_'+(nbFlux).toString()+'_'+i,className:'lecteur_p'});
text_resume=description.firstChild.nodeValue.stripTags().substring(0,100);
//alert(text_resume);
if(description.firstChild.nodeValue.stripTags().length > 100)
{
text_resume=text_resume.substring(0,text_resume.lastIndexOf(' '));
text_resume+='...';
}
resume.innerHTML=text_resume;
div_item=Builder.node('div',{className:'item'});
if(test_image)
{
//div_image.width=div_image.width / 2;
//div_image.height=div_image.height / 2;
div_item.appendChild(div_image);
[#red] hauteur=div_image.height;
rapport=hauteur/div_image.height;
[/#]
if(div_image.width > 180)
{
if(div_image.width > 250)
{
hauteur=rapport * 200;
div_image.width=200;
}
br=Builder.node('div',{style:"height"+hauteur+";clear:left;"});
div_item.insertBefore(br,div_item.childNodes[1]);
margin=(230-div_image.width)/2;
div_image.style.marginLeft=margin+'px';
}
}
voila mon code, qui marche sous FF et non sous IE , je ne comprend pas pouequoi la variable 'hauteur' est egale a 0 sous IE
auriez vous une idée svp ?
Modifié par hakkou (04 Jun 2007 - 11:38)