Jquery, ajax, fadeIn, fadeOut?

Rewritten using delegate: $(function(){ $('#pagg'). Delegate('a', 'click', function(event){ event.preventDefault(); var link = $(this). Attr('href'); $('.

News'). FadeOut(2000). Remove(this); $.

Ajax({ url: link, type: 'get', success: function(html){ $('#pagg'). Html(html). Find('.

News'). FadeIn(2000); } }); }); return false; }).

Hmmm, it seems that this function is not working. After the click, nothing is being shown. – Sasha Sep 12 at 16:38 I made the assumption that the the .

News class was under the #pagg id, if not remove the . Find('. News') part.

Looks like I also have an extra closing tag in there: editing that out. – Mark Schultheiss Sep 12 at 17:44.

Modify the update_page function to this: function update_page(html){ return $('#pagg'). Html(html); } so that .fadeIn() gets called on a jquery object.

I think your update_page needs to return the jQuery object so it can be chained function update_page(html){ return $('#pagg'). Html(html); }.

Update_page() is not a jQuery object. Try: function update_page(html){ $('#pagg'). Html(html).

FadeIn(2000); }.

Two issues: one is the chain the other is the call: function update_page(html){ $('#pagg'). Html(html). FadeIn(2000); } $(function(){ $('#pagg > a').

Live('click', function(event){ event.preventDefault(); var link = $(this). Attr('href'); $('. News').

FadeOut(2000, function(){ $. Ajax({ url: link, type: 'get', success: function(html){ update_page(html); } }); }); return false; }); }); EDIT: This code does bother me a bit in that IF you are fading from one class of . News to another NEW class, the old one will still BE there and they BOTH will fade back in.

If that is also an issue you may want to remove the old one prior to fade in of the new one...or even prior to the new insertion of new content.

I change bottom part with: $(function(){ $('#pagg > a'). Live('click', function(event){ event.preventDefault(); var link = $(this). Attr('href'); $('.

News'). FadeOut(1000, function(){$(this).remove();}); $. Ajax({ url: link, type: 'get', success: function(html){ update_page(html).

FadeIn(2000); } }); }); – Sasha Sep 12 at 15:52 I still think you need to move the fadeIn to the function where it creates the content so that the fadeIn is called on the new jquery object not on the function object. – Mark Schultheiss Sep 12 at 16:07 It is working, but another problem has appeared. Delete function which is associated with tag is not working after this function is activated.

– Sasha Sep 12 at 16:18 I don't see a delete function... – Mark Schultheiss Sep 12 at 16:29 $(". Delete"). Click(function() {var commentContainer = $(this).parent(); var id = $(this).

Attr("id"); var string = 'id='+ id ; $. Ajax({ url: "", type: "POST", data: string, cache: false, success: function(){commentContainer. SlideUp('1500', function() {$(this).remove();});} }); return false; }); $('.

Delete'). Confirm( { msg: 'You are about to delete this article. Are you sure?', buttons: {separator: ' - '}}); – Sasha Sep 12 at 16:56.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions