Closed S0VIET closed 12 years ago
I can't reproduce the problem you're seeing ( http://plugins.learningjquery.com/expander/test/?single%20block%3A%20slicePoint%20200%2C%20without%20preserving%20word%20boundaries )
would you mind putting together a reduced test case that shows the problem so I can take a look at what's going on? something on http://jsfiddle.net or http://jsbin.com would be ideal.
thanks!
jsfiddle wasn't working too well so I copied the source and made it work on this:
http://205.185.127.183/~soviet/test.html
As you can see, the first entry cuts off at 100 chars, and the second cuts off at the desired 200 chars.
That's right. It's working exactly as you are instructing it to work. The first entry cuts off at 100 characters because you have called .expander()
without any options and 100 characters is the default:
$('dl.expander dd:eq(0)').expander();
The second one cuts off at 200 characters because you are calling .expander()
with a bunch of options (including slicePoint: 200
) for every <dd>
element greater than index 0 (all but the first, or ... :gt(0)
):
$('dl.expander dd:gt(0)').expander({
preserveWords: true,
slicePoint: 200,
// etc.
});
If you want all of them to act the same way, just remove the first call — the one without the options — and change the selector of the second to include all of the <dd>
elements:
$('dl.expander dd').expander({ // your options go here });
Thank you, that solved my problem. I'm not very good with Javascript as I haven't had the need to work with it's code excessively.
No problem. Glad you were able to get it working.
Hi, When I try to set the option slicePoice to something other than the default, it doesn't work and cuts off at the default 100chars, here's my JS:
Thanks.