3

I'm using jQuery Expander to truncate some text (adding 'read more' button). It works fine on default text, but once I load up some fresh content via Ajax the plugin doesn't work anymore (on the newly-loaded text).

Any suggestions on how to fix this?

Stormbytes
  • 189
  • 4
  • 11
  • 1
    Code?? You may need to reload the plugin for the text again. You also may need to contact the plug-in creator. – beatgammit Apr 19 '11 at 04:23
  • The new text is probably not registered with the plugin. Calling the the plugin again (after ajax call is complete) should fix it – JohnP Apr 19 '11 at 04:35
  • Are you calling the expander code on any event of the elements which come through Ajax. If so try using live. You can find it at - http://api.jquery.com/live/ – KutePHP Apr 19 '11 at 06:11
  • Exactomondo. Had to re-bind the plugin on the AjaxSuccess callback. Thanks folks! – Stormbytes Apr 29 '11 at 01:57
  • 2
    If possible, please add the answer to this question and accept it, this will help for stackoverflow users in future.. – Vishwanath Oct 04 '11 at 13:42

1 Answers1

0

I solved the issue by using $('.....').expander('destroy');