upgrade readmore.js and improve collapsing a little
This commit is contained in:
@@ -659,7 +659,7 @@ function collapseHeight() {
|
||||
var position = $(window).scrollTop();
|
||||
|
||||
$(".wall-item-content, .directory-collapse").each(function() {
|
||||
var orgHeight = parseInt($(this).css('height'));
|
||||
var orgHeight = $(this).outerHeight(true);
|
||||
if(orgHeight > divmore_height) {
|
||||
if(! $(this).hasClass('divmore')) {
|
||||
|
||||
@@ -679,7 +679,7 @@ function collapseHeight() {
|
||||
beforeToggle: function(trigger, element, expanded) {
|
||||
if(expanded) {
|
||||
if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) {
|
||||
$(window).scrollTop($(window).scrollTop() - (orgHeight - divmore_height));
|
||||
$(window).scrollTop($(window).scrollTop() - ($(element).outerHeight(true) - divmore_height));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user