kswedberg / jquery-expander

Expand and Collapse HTML content

Home Page:https://kswedberg.github.io/jquery-expander/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not working when i set data using ajax

socialinfotech215 opened this issue · comments

not working when i set data using ajax so how can i solve this issue?...

I'm not sure exactly what the circumstances are. If you could provide some code that shows the problem, that would be helpful.

One thing to note, though, is that the content has to be in the document before you can act on it. So if you are inserting content with ajax, you should call .expander() on that content in a callback after it has been inserted. Something like:

$.ajax('/some/content')
.then(function(html) {
  $(html).appendTo('#mydiv');
  $('#mydiv').find('.something-to-expand').expander();
})

thanks its working...
but how can i stop load content when first time page load...??