Table problem please HELP :)
Hello, all Jquery Gurus
i'm new in JavaScript, but i like JQuery very much
I'm doing now some project and trying to use JQ.
I'm loading data from PHP file into table and i would like to use <button> or other tag to make that <td>data</td> visible (it's default hidden).
-
$(document).ready(function(){
$("a#more").toggle(function()
{
$("td").next("td#more").show('slow');
$("a#more").text('Schowaj');
},
function()
{
$("td").next("td#more").hide('slow');
$("a#more").text('Pokaż');
}
);
$("a#more1").toggle(function()
{
$("td").next("td#more1").show('slow');
$("a#more1").text('Schowaj');
},
function()
{
$("td").next("td#more1").hide('slow');
$("a#more1").text('Pokaż');
}
);
$("a#more2").toggle(function()
{
$("td").next("td#more2").show('slow');
$("a#more2").text('Schowaj');
},
function()
{
$("td").next("td#more2").hide('slow');
$("a#more2").text('Pokaż');
}
);
});
HTML document looks smth like that:
<a id="more>More</a><a id="more1>More1</a><a id="more2>More2</a>
<table>
<tr><td>Blabla</td>Blabla<td>Blabla</td><td id="more">Hidden data</td><td id="more1">Hidden data2</td><td id="more2">Hidden data3</td></tr>
</table>
When i press buttons from End to Beginning ecerything looks fine, but if i press them in other order. It make <td><td></td></td> i think. And i looks horrible.
When i use