-2

I have this $('#zSlider .description li').mouseover(function(){

I want the function to execute after 1 second or whatever amount I choose.

This is my first day ever of looking at code of any sorts, i don't know what I'm doing, be specific. I'm just googling and trying to modify stuff on my wordpress page.

  • 1
    You will not get far if you are not trying yourself and asking for SO to do 100% of the lifting for you. – Mark Dec 12 '13 at 19:12
  • or [How to add delay to jquery mouseover?](http://stackoverflow.com/questions/15575993/how-to-add-delay-to-jquery-mouseover), etc. etc. Next time you might consider using google first? – Liam Apr 24 '14 at 15:50

2 Answers2

0

The mouseenter event seems better suited for this, and add a timeout :

$('#zSlider .description li').on('mouseenter', function(){
    setTimeout(function() {
        // do stuff once the second has passed
    }, 1000);
});
adeneo
  • 312,895
  • 29
  • 395
  • 388
0

Try using .delay() function like this:

$(function() {
  $('selector').mouseover(function() {
    $(this).children(".abc").delay(1000).show(0);
  });
});
Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331