Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

jQuery Slide function + ajax

  • 06-12-2007 09:24PM
    #1
    Registered Users, Registered Users 2 Posts: 3,484 ✭✭✭


    Hi Lads,

    So I've basically created a calendar and I'd like to click on a date and a hidden div would appear containing things happening on that date.

    I was wondering

    1st do I have to create 31 empty divs and use ajax to populate the ones that have events in them

    and

    2nd Just wondering if anyone had a simple function to use the jquery slide? Did a google but all the code seems to be broken up?

    I basically have a hidden div that I would like to "slide" appear when I click on something?

    Hope it isn't too difficult!

    Thanks
    Gary


Comments

  • Registered Users, Registered Users 2 Posts: 3,594 ✭✭✭forbairt


    Would it not make more sense to have one div hidden ... you make an ajax call for that date and it populates the div and slides in ?


  • Registered Users, Registered Users 2 Posts: 3,484 ✭✭✭randombar


    That's definitely a better idea all right, is there any easy code for the slide? Something like show and hide JS?

    Thanks
    Gary


  • Registered Users, Registered Users 2 Posts: 3,594 ✭✭✭forbairt


    http://docs.jquery.com/Tutorials:Live_Examples_of_jQuery
    $("div.contentToChange p.firstparagraph:hidden").slideDown("slow");
    $("div.contentToChange p.firstparagraph:visible").slideUp("slow");
    

    should do the trick ? slightly modified of course


  • Registered Users, Registered Users 2 Posts: 3,484 ✭✭✭randombar


    Hi,
    I'm bringing this up again (sorry) got it working ok but it only works with a fixed height div:

    Click on the dates: http://www.ratemypub.ie/template/index.php

    anyone know how i can change it to dynamic? that jquery stuff seems a bit over my head for some reason?


Advertisement