kswedberg / jquery-expander

Expand and Collapse HTML content
https://kswedberg.github.io/jquery-expander/
Other
459 stars 167 forks source link

Show / Hide behaves badly with <p> tags in .expand div #41

Open nomaddesign opened 12 years ago

nomaddesign commented 12 years ago

If you add paragraph tags inside the .expander element the show / hide shows or hides the entire text..... not just the expanded (read more) text. Is there a way to configure jquery-expander to avoid this? I'm I missing something simple?

Try adding paragraph tags to this and see what I mean: http://jsfiddle.net/6dW6U/14/

Thanks!!!!

tillebeck commented 12 years ago

That is not a bug but a feature :) Se example nr. 3 on the demo page specifically about block elements: http://plugins.learningjquery.com/expander/demo/index.html

kswedberg commented 12 years ago

@tillebeck is right. The text is sliced at the appropriate point, and that is shown initially. When "expanded," that first, sliced, text is hidden while the entire content is shown.

@nomaddesign: If we're misunderstanding your report, feel free to re-open this issue or open another with an example of it failing.

Thanks!

nomaddesign commented 12 years ago

Behavior with block element only: http://jsfiddle.net/6dW6U/14/ -This works great -

Behavior with

tags inserted inside block element http://jsfiddle.net/y8JnX/

Now the behavior changes dramatically. The text completely disappears and then reappears and starts expanding. The resulting animation is -jarring- and confusing to viewers because it appears the text has changed NOT expanded.

kswedberg commented 12 years ago

For now, my recommendation would be to use a different effect. Either fadeIn/fadeOut or show/hide. Sorry. :(