Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-22-2012, 10:14 PM   PM User | #1
kamaro
New Coder

 
Join Date: Jan 2012
Posts: 40
Thanks: 8
Thanked 0 Times in 0 Posts
kamaro is an unknown quantity at this point
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
kamaro is offline   Reply With Quote
Old 01-22-2012, 10:45 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
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.
devnull69 is offline   Reply With Quote
Old 01-22-2012, 10:51 PM   PM User | #3
kamaro
New Coder

 
Join Date: Jan 2012
Posts: 40
Thanks: 8
Thanked 0 Times in 0 Posts
kamaro is an unknown quantity at this point
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?
kamaro is offline   Reply With Quote
Old 01-23-2012, 06:56 AM   PM User | #4
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
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>
devnull69 is offline   Reply With Quote
Old 01-23-2012, 07:06 AM   PM User | #5
riptide
Regular Coder

 
riptide's Avatar
 
Join Date: Jan 2007
Posts: 143
Thanks: 1
Thanked 0 Times in 0 Posts
riptide is an unknown quantity at this point
you know you can also do this with opacity and transitions.
riptide is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:50 PM.


Advertisement
Log in to turn off these ads.