You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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));
}
When you initiate resize it creates some DOM elements inside the element you applied resize..
Maybe you delete these elements and then it wont work anymore
@clarkk is right. If (((my function here))) alters the DOM of the container too much it will stop working. Calling .html() or .empty() on the contentArea will break it. I think there might also be an issue if you set the css position to certain values.
To avoid the former you can either keep track of what elements you're putting into the contentArea with a class or something, that way you can remove them specifically and add new content using the append() function rather than html().
Or you could just add another wrapper for the content within contentArea e.g. actualContent which could be a div with width:100%:height:100%. That way you'd never mess with the contentAreadiv in a way that would disable the resize triggers.
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:
Here's the function I trigger, which is aimed at making the sidebar as long as the primary container:
And this is what happens as I load the page:
The text was updated successfully, but these errors were encountered: