Neil Burton
Neil Burton

Reputation:

Can't assign jQuery jqModal to dynamically added links

I've been having problems getting jqmodal modal dialogs to display on links added dynamically by client side code. I've demonstrated the problem at the following URL: http://www.neil-burton.co.uk/jqmodaltest/index.htm

Any help would be appreciated

Upvotes: 1

Views: 686

Answers (1)

redsquare
redsquare

Reputation: 78687

You can use .live for the anchor click events

UPDATED AGAIN

  $('#dialog').jqm({ajax:'@rel'});

  // open the modal whenever anchor links on the page are clicked
  $('a.someClass').live('click',function(){
      $('#dialog').jqmShow(this);
  });

Upvotes: 2

Related Questions