jQuery Expander plugin loses expand effect if beforeExpand callback function is defined
Hi, I was using the jQuery Expander plugin...love the effect but when I mapped a callback function to beforeExpand, the function and the default expandEffect only work the first time the expand link is clicked:
- $(document).ready(function() {
- $("#story p:gt(0)").expander({
- slicePoint: 512,
- widow: 4,
- expandText: 'more',
- expandPrefix: '… ',
- expandSpeed: '2000',
- userCollapseText: 'less',
- userCollapsePrefix: ' …',
- beforeExpand: function() {
- $("#copyright").fadeOut(200);
- },
- onCollapse: function($thisElement, byUser) {
- $("#copyright").fadeIn(200);
- }
- });
- });
Basically I want a div with id="copyright" to fade away when the text is expanded and fade back in when the text is collapsed. What happens is that everything works correctly the first time I expand the text, but then when I collapse it, div#copyright does not fade back in. Additionally, when I expand the text a second time or subsequent times, it does not fadeIn like before, but just appears. If I don't specify a beforeExpand callback function, then the expanding text fades in correctly no matter how many times I click the expand link. Any help would be greatly appreciated!
-albeeboy