Skip to content

sometimes it doesn't work. #46

@unalignedcoder

Description

@unalignedcoder

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)))
	});
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions