Below i have posted the code for my Question.On clicking the anchor link, it does toggle. but the class"mytbody3"should hide on anchor link sliding down. i understand, an if condition should solve this but with limited jQuery coding knowledge, i am not sure how to write it. can someone help with this.

You should be able to achieve that by changing the .show() to .toggle() instead.

$('.mytbody3').toggle();

Jesh
—
2013-05-02T16:15:08Z —
#3

Thanks Paul.I have one more task similar to this. can you demonstrate this with slideUp and slidDown functionality and animate the sliding for few seconds.That is of great help as these are the functionalities that I am handling now.

Thanks,Jesh

Jesh
—
2013-05-02T17:38:19Z —
#4

I need the animate effect, as it slides up , the tbody3 should gradually show ..come up and vice versa.I am working on it. Meanwhile, if I get code , that's of great help.

Paul_Wilkins
—
2013-05-02T21:25:17Z —
#5

Jesh said:

I need the animate effect, as it slides up , the tbody3 should gradually show ..come up and vice versa.I am working on it. Meanwhile, if I get code , that's of great help.

Wouldn't using slideToggle instead of toggle achieve that?

Jesh
—
2013-05-02T23:10:14Z —
#6

paul_wilkins said:

Wouldn't using slideToggle instead of toggle achieve that?

The problem is I am not sure on how? I am working, pros and cons with lot of search.

Paul_Wilkins
—
2013-05-03T20:34:35Z —
#7

Jesh said:

The problem is I am not sure on how?

Not sure on how? Instead of .toggle(), you use .slideToggle() - it should be as easy as that.

Jesh
—
2013-05-04T01:28:10Z —
#8

ok..after going through few articles, documentation and examples, tried various ways.

giving,$('.mytbody1').toggle(); //this is what works. giving $('.mytbody1').slideToggle(); makes the mytbody3 to appear first and then toggles up. so changed slideToggle to toggle.$('.mytbody3').toggle();

actually the above two lines toggles perfect but i need gradual sliding. i also tried with slideUp, it slidesUp but not gradually. i messing/missing something.

once again i put my question here: .mytbody1 slides up gradually and hides while .mytbody3 comes out gradually and shows and vice versa on clicking the anchor link. the link also goes up and down as per the sliding.

i am making some mistakes in jQuery and not able to identfify the correct syntax. will try to give an working external link.Any help is highly appreciated. got to finish this. any working example would be great.

Thanks.

Paul_Wilkins
—
2013-05-04T01:34:40Z —
#9

Tables cause problems when it comes to animating things like that. See for example some test code at http://jsfiddle.net/pmw57/yZP7s/The table row only animates to the minimum height of the row. Beyond that, the row just hides itself.

You may have much greater success with the sliding animation by not using tables for layout - which is a big no-no, and instead use divs and some CSS to achieve the layout.

Jesh
—
2013-05-04T02:27:00Z —
#10

paul_wilkins said:

Tables cause problems when it comes to animating things like that. See for example some test code at http://jsfiddle.net/pmw57/yZP7s/The table row only animates to the minimum height of the row. Beyond that, the row just hides itself.

You may have much greater success with the sliding animation by not using tables for layout - which is a big no-no, and instead use divs and some CSS to achieve the layout.

hey paul, i am stuck here and i need to fix this. it's going to be table. so there is not going to be any other layout. cannot call jquery inside html(not in content). will calling .td or .tr. or using .parent().child()..some syntax using this will work? if so, how i should write it. i have been seeing lot of these syntax while search.

thanks.

Paul_Wilkins
—
2013-05-04T02:28:54Z —
#11

Jesh said:

hey paul, i am stuck here and i need to fix this. it's going to be table. so there is not going to be any other layout. cannot call jquery inside html(not in content). will calling .td or .tr. or using .parent().child()..some syntax using this will work? if so, how i should write it. i have been seeing lot of these syntax while search.

thanks.

If you're stuck with tables, then you will also be stuck with the layout requirements - the min-height row requirements - that table rows have too.

I have no solution for you there in regard to tables.

Jesh
—
2013-05-06T20:39:16Z —
#12

Hi,

One more question,

The anchor text has to change as it slides up and down in the code that i posted at the start.How will I achieve it?

Thanks.

Paul_Wilkins
—
2013-05-16T05:31:42Z —
#13

Jesh said:

The anchor text has to change as it slides up and down in the code that i posted at the start.How will I achieve it?

A good way to do that is to wait until the slideToggle has finished, and then check if what you are sliding is visible.You can the set the text to what you want it to be, based on whether things are visible or not. For example: