Killersites Community: Jquery fadeIns - Killersites Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Jquery fadeIns

#1 User is offline   antpower26 

  • PipPip
  • Group: Member
  • Posts: 27
  • Joined: 26-April 11

Posted 22 August 2011 - 10:47 AM

Hi
I am just coding in jquery for the first time :script type="text/javascript">

$(document).ready(function(){
$("#appearingduo").fadeIn('slow', function () {
// fade has finished
});
});
</script>
</head>
The syntax is a little confusing, for that reason. on my current build I am trying to fade in an image, it is working, but I would like the fade in to slow down to
say around 2 seconds, I am having trouble making this happen, please help:))))


Ant
0

#2 User is offline   Ben 

  • View blog
  • Group: Administrators
  • Posts: 5,409
  • Joined: 19-December 08
  • LocationChico, CA

Posted 22 August 2011 - 11:36 AM

The jquery documentation is pretty helpful for this sort of thing: http://api.jquery.com/fadeIn/

To adjust the speed, change 'slow' to a number of milliseconds:

<script type="text/javascript">
$(document).ready(function(){
   $("#appearingduo").fadeIn(2000, function () {
   // fade has finished
   });
});
</script>

Also, keep in mind that if you don't need any sort of javascript action after the fade has finished, you can drop the "function()" section like this:

<script type="text/javascript">
$(document).ready(function(){
   $("#appearingduo").fadeIn(2000);
});
</script>

Benjamin Falk | Falken Creative : Twitter : KillerSites Screencast Blog
Skills: Photoshop, Illustrator, HTML, CSS, jQuery, PHP and CodeIgniter
0

#3 User is offline   antpower26 

  • PipPip
  • Group: Member
  • Posts: 27
  • Joined: 26-April 11

Posted 22 August 2011 - 03:04 PM

Thanks Ben that works great:)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users