user2500013
user2500013

Reputation: 1

Using jQuery delay method to delay text

I want to use the .delay() method to make a text appear after 3 seconds when a link(button) is clicked. I don't have much experience with jQuery so this might be very easy. Here is the code i was using:

$(document).ready(function() {
  $('div.ico-productm').click(function(){
     $('div-fade1').delay(3000)
  });
}); 

It doesnt work this, do I need to use something else after the .delay, or reorder the functions somehow?

Upvotes: 0

Views: 139

Answers (1)

user123_456
user123_456

Reputation: 5805

If div-fade is a class then add . if it is an id add # because there is no element div-fade1

Something like this:

$(document).ready(function() {
  $('div.ico-productm').click(function(){
    $('.div-fade1').delay(3000)
  });
}); 

Or maybe fade1 is a class or an id the you can have something like:

$(document).ready(function() {
      $('div.ico-productm').click(function(){
        $('div.fade1').delay(3000)
      });
    }); 

Upvotes: 1

Related Questions