Jump to content

Turning this Javascript into Ajax?


TeddyKiller

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.