TeddyKiller Posted May 27, 2010 Share Posted May 27, 2010 I want to turn this Javascript into JQuery Ajax.. so when its set to display, it'll.. slide down. Just not sure how i'd do it.. any help? Thanks! function showComments(Comment_Menu) { Comment_Menu = document.getElementById(Comment_Menu); if(Comment_Menu.style.display == "none") { Comment_Menu.style.display = "block"; } else if(Comment_Menu.style.display == "block") { Comment_Menu.style.display = "none"; } } When you click the ahref, the onclick event calls this function. So basically.. when it gets to display, it should slide down, then it gets to .. hide, to slide up. Link to comment https://forums.phpfreaks.com/topic/203137-turning-this-javascript-into-ajax/ Share on other sites More sharing options...
trq Posted May 28, 2010 Share Posted May 28, 2010 You might want to look into what Ajax actually is. It has nothing to do with page element effects. Link to comment https://forums.phpfreaks.com/topic/203137-turning-this-javascript-into-ajax/#findComment-1064435 Share on other sites More sharing options...
TeddyKiller Posted May 28, 2010 Author Share Posted May 28, 2010 I've used ajax before, and.. with the JQuery plugin, it allows some effects, like slidein slideout, fadeout, fadein etc. I just wanted similar to above... but with that slidein and slideout effect. I could do something similar.. but not with a function call, it'd be a ready function... which doesn't really allow what I'm doing to do.. because it has unique id's and its in a while, it's unique by id's on the div id's... but if it's not possible then.. perhaps maybe you can suggest a solution that'd work? Link to comment https://forums.phpfreaks.com/topic/203137-turning-this-javascript-into-ajax/#findComment-1064513 Share on other sites More sharing options...
RichardRotterdam Posted May 28, 2010 Share Posted May 28, 2010 I've used ajax before, and.. with the JQuery plugin, it allows some effects, like slidein slideout, fadeout, fadein etc. I just wanted similar to above... but with that slidein and slideout effect. As mentioned before that's not ajax that's just javascript effects. The examples are pretty straight forward in the jQuery documentation http://api.jquery.com/category/effects/ Link to comment https://forums.phpfreaks.com/topic/203137-turning-this-javascript-into-ajax/#findComment-1064548 Share on other sites More sharing options...
trq Posted May 28, 2010 Share Posted May 28, 2010 I'll just repeat my last response. You really should look into what Ajax actually is. Link to comment https://forums.phpfreaks.com/topic/203137-turning-this-javascript-into-ajax/#findComment-1064582 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.