This question follows on from one I recently asked here: Matching column height in 2column layout
I applied the JQuery fix suggested, but I now have a problem that if the column set presented on page load is shorter in height than another one as chosen by the submenu items on the left, the text in the content column runs over the footer.
http://www.pcbuddies.co.za/Services/Default.aspx (Click on the Hardware Repair link to see)
Here's the code:
<!-- JQuery matches the height of one column to the height of the other -->
<script type="text/javascript" src="../Data/jquery.js"></script>
<script type="text/javascript">
var tallest=0;
$(document).ready(function(){
$('.col').each(function(){
if($(this).height() > tallest)
tallest = $(this).height();
});
$('.col').css('height', tallest + 'px');
});
// I had an idea to reset the column matching for the hardware repair
// menuitem click which didn't work.
$('#hardwareitem').click(function(){
$('.col').each(function(){
if($(this).height() > tallest)
tallest = $(this).height();
});
$('.col').css('height', tallest + 'px');
});
</script>
<li id="hardwareitem"><a onclick="cycle('hardware');">Hardware Repair</a></li>
<div id="hardware" style="display: none;"><!-- Content goes here --></div>
<!-- JS to change content is simply css class changes to make the selected content visible while hiding the currently visible content -->
I know JQuery probably isn't the best way to do this, but I just want to use it as a quick fix while applying a CSS solution.
Can anyone see a problem in the code or logic that would suggest why clicking #hardwareitem
doesn't change the column height?