Hello,
I'm going to make a portfolio and am trying to use jquery for effects.
Basically I have several menus and when I click on any of them the showed text in content div of page should change, using ajax. These are levels:
a) SlideUp the #Content div
b) Change the innerHTML of #Content div, using ajax
c) SlideDown, to show the new content
This is the function doing it for me:
function showContent(x){
$("#content").slideUp("slow", function(){
var cont = document.getElementById("content");
if (window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest();
else
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET",x+".txt",false);
xmlhttp.send();
cont.innerHTML = xmlhttp.responseText;
});
$("#content").slideDown("slow");
}
But the problem is, if for example "menu a"'s text is vertically 300px long, and "menu b"'s textis 200px long. If I first click on "menu a" then click on "menu b" after sliding down the div, it'll go down to 300px then suddenly its height changes to 200px, which is obviously not what I want.
Any help will be appreciated.
Thanks
Soben