0

I have a jquery calendar wich it takes events from a php file wich is feeding json data. I want to bind a function on every event added to calendar. And I did this:

$(this).bind("mouseenter", function(){
        alert("a");
        });

It works, but only on second rollover on each event. First time I roll over nothing happens.

Anthony
  • 36,459
  • 25
  • 97
  • 163
arrd
  • 41
  • 8

1 Answers1

0

There are a couple of ways you can achieve this using JQuery.

$(selector).live( evt, function(){} ); // for JQuery 1.7 and less. 

$(document).on( evt, selector, function(){} );

Event Delegation is yet another way you can use to achieve this.

consider this link => http://learn.jquery.com/events/event-delegation/

Talha Masood
  • 993
  • 1
  • 7
  • 22