kswedberg / jquery-expander

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

preserveWords: false not working #112

Closed kriskoon closed 8 years ago

kriskoon commented 8 years ago

I cannot get words to split when the preserveWords option is set to false. In the html below, the string of text inside the div should split after j, but, in fact, it does not split at all, even on the space.

<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="jquery-1.11.3.min.js"></script>
<script src="jquery.expander.js"></script>
<script>
$.expander.defaults.slicePoint = 10;
$(document).ready(function() {
  $('div.expandable').expander({preserveWords: false});
});
</script>
</head>
<body>
<div class="expandable">
abcdefghijklmnopqrstuvwxyz 1234567890
</div>
</body>
</html>
kriskoon commented 8 years ago

It looks like the html was removed from my post. That text string was in a div with class expandable and the jquery and expander scripts were included in the head section, along with:

$.expander.defaults.slicePoint = 10; $(document).ready(function() { $('div.expandable').expander({preserveWords: false}); });

in a script block.

kswedberg commented 8 years ago

sorry for the delay. I'll take a look this weekend.

kswedberg commented 8 years ago

fyi... I just edited your first comment so I could read it.

kswedberg commented 8 years ago

Sorry it took me so long. The fix is in, with a test to ensure it's working right.