
Question:
I'm really not that good at Javascript and that, so I need another bit of help. I want to be able to do a quick bit of AJAX using PHP then when the ajax response is finished show the response in a div and SLIDE it down nicely.
The basic AJAX side of it is no problem. But I want to be able to have it slide nicely without using any framework like jQuery or MooTools. Mainly for learning, but there are other reasons. So, any help on a very simple way od doing so would be handy. I can't really find much online. If I have to use jQuery then I guess I can, I have played about with it but I'm not a fan of Javascript at the best of times...
So yeah, pretty much any advice/tips/thoughts/help would be really handy!
Answer1:I guess the basics would be something of a timeOut() in combination with increasing the height until it is full height:
<ol><li>set the display of the element to none</li> <li>get the full height of the element, something like:<br /><strong>document.getelementById('IDofElement').style.height</strong></li> <li>set the height to 0 and the display to something like block</li> <li>set a <strong><a href="http://www.w3schools.com/js/js_timing.asp" rel="nofollow">timeOut()</a></strong> and increase the height in the called function, activate a new timeOut() if the element is not already full height.</li> </ol>The only real disadvantage of not using a library would be that you would have to test in a lot of different browsers and perhaps make modifications according to the browser used. Libraries have already solved that problem for you.
Answer2:Personally, I'd just use JQuery. If you want to see how they do it, then download the developer version of the library and look at the code.
If you're not a fan of javascript, then use a library, it means you have to write less.