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 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2012
    Posts
    40
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Loading content with fade effect

    I am trying to make content load by fading into the page instead of refreshing the page. I don't know how to do this however. I found a great video that has exactly what I need but it didn't seem to work. I'm not sure if it's becasue AJAX (which i have no clue exactly what it is) becasue I don't think I'm using it. Please help and thank you.

    VIDEO: http://www.youtube.com/watch?v=H0XnZsxxKFQ

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,391
    Thanks
    11
    Thanked 565 Times in 558 Posts
    You can fade in content that is already there with no page refresh. You won't need any Ajax here. But as soon as you try to get additional content from your server and fade it in afterwards without refreshing the page, you'd need Ajax.

    Go ahead and search for "simple Ajax example" in Google and you will find tons and tons of self explaining examples.

  • #3
    New Coder
    Join Date
    Jan 2012
    Posts
    40
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Ya I want it so when a link is clicked it fades content from another html file. But ya thanks for the advice. One last thing - Why didn't the code in the video work. Can it be used with other jquery lines?

  • #4
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,391
    Thanks
    11
    Thanked 565 Times in 558 Posts
    The example from the video will work

    Let's say you have some code like this
    Code:
    $('#myelement').hide().load('some.php').fadeIn('normal');
    it will definitely work, provided that you have

    1. an element somewhere on your current page with id="myelement" and
    2. jQuery included ... with a line like this one
    Code:
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>

  • #5
    Regular Coder riptide's Avatar
    Join Date
    Jan 2007
    Posts
    143
    Thanks
    1
    Thanked 0 Times in 0 Posts
    you know you can also do this with opacity and transitions.


  •  

    Posting Permissions

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