Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JQuery put text into a div onclick

    Hi guys I learn how to let blink links with fading onclick.
    But now I would like to put text and pictures in a page div when I click on a link without load again the page. How can I script it?
    This is my noob script for links:
    <script type="text/javascript">
    $("a").click(function(event){
    event.preventDefault();
    $(this).fadeOut("slow");
    $(this).fadeIn("slow");
    });
    </script>

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    The ajax function load() will fill in a div (or whatever container) from another source (such as an html page or PHP script or whatever).

    http://docs.jquery.com/Ajax/load#urldatacallback


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •