Josh
Josh

Reputation: 615

jquery mobile .on not working on page load, only after refresh

This function only works after I refresh the page on jquery mobile.. any ideas?

$('.item').on('touchstart pageinit', function(){

I am trying to make something clickable that toggles a classs.. ie: a button. Only works after refresh.

Upvotes: 0

Views: 581

Answers (1)

Gajotres
Gajotres

Reputation: 57309

Try this:

$(document).on('touchstart pageinit', '.item', function(){

Upvotes: 2

Related Questions