PDA

View Full Version : Someone PLEASE help me with jQuery



crazyryan
03-04-2008, 12:49 PM
Hey

I'm having a real pain getting someone to help me with this. I've never used javascript before and I dont know how or what to do.

Basically, I have a a table and in the last column of each row, I want something like view all, and on clicking that view all, a new row will slide down underneath it and show some more details, I want that row to be the full width of the table (also stuck on that), but I have no idea how to apply jquery to that table, can anyone help?

This is the effect I want: http://docs.jquery.com/Effects/slideDown#speedcallback

jscheuer1
03-04-2008, 01:42 PM
As far as I can see, that effect is for divisions, not table elements.

city_coder
03-04-2008, 01:46 PM
Yeah just as js said, its not used for tables. I sort of have that same effect on my site(this site is just an absolute mess around of testing CSS, JQuery & AJAX). Massive work to do on it and im working on it, so if it goes down then just keep refreshing.
See the hide image tag...that might be what u want, only it wont be shown by default for you.


function showhide(targetID) {
//change target element mode
var elementmode = document.getElementById(targetID).style;
elementmode.display = (!elementmode.display) ? 'none' : '';
}
function changetext(changee,oldText,newText) {
//changes text in source element
var elementToChange = document.getElementById(changee);
elementToChange.innerHTML = (elementToChange.innerHTML == oldText) ? newText : oldText;
}
function workforchange(targetID,sourceID,oldContent,newContent) {
showhide(targetID);
changetext(sourceID,oldContent,newContent);
}

city_coder
03-04-2008, 01:49 PM
oops sorry code is all over the place, pressed tab and enter by mistake.


//goes in head tag
function showhide(targetID) {
//change target element mode
var elementmode = document.getElementById(targetID).style;
elementmode.display = (!elementmode.display) ? 'none' : '';
}
function changetext(changee,oldText,newText) {
//changes text in source element
var elementToChange = document.getElementById(changee);
elementToChange.innerHTML = (elementToChange.innerHTML == oldText) ? newText : oldText;
}
function workforchange(targetID,sourceID,oldContent,newContent) {
showhide(targetID);
changetext(sourceID,oldContent,newContent);
}
//html
<a href="javascript:workforchange('image','changer','Hide Image','Show Image');" id='changer'>Hide Image</a><img id="image" align="left" src="image.png">


sorry about the cock-up lol u can tell im a newbie at posting lol

www.mewan.net/mark/css/html.php