2011-04-25 61 views
3

我使用的是jQuery Expander插件。我希望它使用像jQuery的slideUp和slideDown这样的效果,而不是默认的fadeIn。如何在jQuery Expander Plug-in中使用jQuery的“slideDown”和“slideUp”效果?

有人能告诉我如何做到这一点?

以下是默认的选项:

$.fn.expander.defaults = { 
    slicePoint:  100,  // the number of characters at which the contents will be sliced into two parts. 
           // Note: any tag names in the HTML that appear inside the sliced element before 
           // the slicePoint will be counted along with the text characters. 
    widow:   4,  // a threshold of sorts for whether to initially hide/collapse part of the element's contents. 
           // If after slicing the contents in two there are fewer words in the second part than 
           // the value set by widow, we won't bother hiding/collapsing anything. 
    expandText:  'read more...', // text displayed in a link instead of the hidden part of the element. 
           // clicking this will expand/show the hidden/collapsed text 
    expandPrefix:  '… ', // text to come before the expand link        
    collapseTimer: 0,  // number of milliseconds after text has been expanded at which to collapse the text again 
    expandEffect:  'fadeIn', 
    expandSpeed:  '',  // speed in milliseconds of the animation effect for expanding the text 
    userCollapse:  true,  // allow the user to re-collapse the expanded text. 
    userCollapseText: '[collapse expanded text]', // text to use for the link to re-collapse the text 
    userCollapsePrefix: ' ', // text to come before the re-collapse link 
    beforeExpand: function($thisEl) {}, // function that is called immediately upon expanding, before the expand occurs 
    afterExpand: function($thisEl) {}, // function that is called after the details have finished expanding 
    onCollapse: function($thisEl, byUser) {} //function that is called when the details are collapsed (immediately after) 

}; 
+2

可能不是,因为引擎盖下的插件正在使用跨度。我相信'slideDown'需要一个设置宽度和高度的元素:http://stackoverflow.com/questions/3886336/alternative-to-jquerys-slidedown-and-slideup-not-affecting-the-display-prope – 2011-04-26 00:34:15

回答