hi everyone
I have a page with a list of items. Each item is in a table with a row
of three td. I also have another row under each item that is hidden.
When I click on an item, it displays that other invisible row and
inputs extra information in it.
Now this works fine in IE and Opera but for some reason when I try it
in firfox, the table display gets messed up.
here's my code :
<!DOCTYPE htm PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?python
def ColorCatalogue(num):
if num % 2 :
return "#EBEBEB"
return "white"
?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/
kid/ns#"
py:extends="'master.kid'">
<head>
<title>Accueil</title>
<script py:for="film in films" type="text/javascript">
addLoadEvent(function(){
connect($('showfilm${film["id_film"]}'), 'onclick',
function (e) {
e.preventDefault();
var d = loadJSONDoc("${tg.url('/
film_json/'+str(film['id_film']), tg_format='json')}");
d.addCallback(showFilmInfo);
});
connect($('hidefilm${film["id_film"]}'), 'onclick',
function (e) {
e.preventDefault();
var d = loadJSONDoc("${tg.url('/
film_json/'+str(film['id_film']), tg_format='json')}");
d.addCallback(hideFilmInfo);
});
});
function showFilmInfo(result) {
var td = document.getElementById("film_info"+result["film"]
["id_film"]);
td.appendChild(document.createTextNode(result["film"]
["info_film"]));
td.style.display = "block";
document.getElementById("catatr"+result["film"]
["id_film"]).style.display = "block";
document.getElementById("catatr"+result["film"]
["id_film"]).style.width = "100%";
document.getElementById("showfilm"+result["film"]
["id_film"]).style.display = "none";
document.getElementById("hidefilm"+result["film"]
["id_film"]).style.display = "block";
}
function hideFilmInfo(result) {
var td = document.getElementById("film_info"+result["film"]
["id_film"]);
td.removeChild(td.lastChild);
td.style.display = "none";
document.getElementById("catatr"+result["film"]
["id_film"]).style.display = "block";
document.getElementById("catatr"+result["film"]
["id_film"]).style.width = "0%";
document.getElementById("showfilm"+result["film"]
["id_film"]).style.display = "block";
document.getElementById("hidefilm"+result["film"]
["id_film"]).style.display = "none";
}
</script>
</head>
<body>
<div id="catalogue_menu">
<table py:if="'distributeurs' in tg.identity.groups" ><tbody>
<tr>
<td style="background: URL(static/images/
onglet_vert.gif) no-repeat;text-align:center;"><a><b>Votre catalogue
(7)</b></a></td>
<td><a>Ajouter un film à votre catalogue</a></td><td></
td>
</tr>
<tr style="background-color:#CDCDCD;height:20px">
<td><a>Trier par : </a> <a>film</a><a>, </a><a>date de
sortie</a><a>, </a><a>type</a> </td>
<td><a>Afficher : </a><a>tous les films</a><a>, </
a><a>les 3 premiers</a></td>
<td style="text-align: left;">Boutons</td>
</tr>
</tbody></table>
</div>
<div id="catalogue">
<table py:for="film in films" id="table${film['id_film']}"><tbody>
<tr id="tr${film['id_film']}" style="align:left;background-
color:${ColorCatalogue(film['id_film'])}">
<td class="nomfilm" id="showfilm$
{film['id_film']}"><img src="static/images/triangle.gif" alt="" /> <a
py:content="film['nom_film']" href="${tg.url('/film_json/')}$
{film['id_film']}">Film.nom_film</a></td>
<td class="nomfilm" id="hidefilm${film['id_film']}"
style="display:none"><img src="static/images/triangledeplie.gif"
alt="" /> <a py:content="film['nom_film']" href="${tg.url('/
film_json/')}${film['id_film']}">Film.nom_film</a></td>
<!-- <td class="sortie" id="sortie${film['id_film']}"
><a>Sortie le 12 décembre 2008</a></td>
<td class="programme" ><a>programmé dans 15 salles</a></td> -->
</tr>
<tr id="catatr${film['id_film']}"
style="align:left;display:none;background-color:$
{ColorCatalogue(film['id_film'])}">
<td id="film_info${film['id_film']}"
style="display:none;" ></td><td style="display:block;"></td><td
style="display:block;"></td>
</tr>
</tbody></table>
<table><tbody>
<tr style="background-color:#CDCDCD;height:20px;"><td
colspan="3"> </td> </tr>
</tbody></table>
</div>
</body>
</html>
I've been through it hundreds of times and I can't seem to figure out
what the problem might be. at first I thought it might be because of
mochikit function so I changed my TD, TR instructions to standard
javascript but it keeps acting up.
Any ideas ? why would Firefox not behave like the others? especially
when IE seems to be okay with it.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---