-
Notifications
You must be signed in to change notification settings - Fork 148
Open
Description
I'm using the jquery version, and it works fine. However the functionality is intermittent.
I'm using this on a wordpress website in combination with the "Collapse O-matic" plugin which expands and collapses parts of the content, stretching the container accordingly. My function wants to stretch the sidebar as well.
What happens is that, as I expand and collapse the content area, the sidebar only grows and shrinks the first time, then it doesn't seem to respond any longer.
This is how I call the function in the footer of the page:
jQuery(function($) {
var myFunc = function() {
(((my function here)))
};
$('#primary').resize(myFunc);
/*$('#primary').removeResize(myFunc); if I don't comment out this line it doesn't work altogether*/
});
Here's the function I trigger, which is aimed at making the sidebar as long as the primary container:
var sidebar = $('.sidebar');
var contentArea = $('#primary');
if (parseInt(sidebar.outerHeight(true)) > parseInt(contentArea.outerHeight(true))) {
sidebar.css('height','');
} else {
sidebar.css('height',contentArea.outerHeight(true));
}
And this is what happens as I load the page:
jQuery(function($) {
$(window).on('resize load', function() {
(((my function here)))
});
});
oliviertassinari
Metadata
Metadata
Assignees
Labels
No labels