im using a jquery ajax method to load different content divs, my content div (the div that get replaced each time i click on a link) has overflow:auto CSS on it, but when i load a page, it adds another scrollbar to my content div like so...
When it should really look like this for each page...
Here is my js...
$(document).ready(function() {
var hash = window.location.hash.substr(1);
var href = $('#links li a').each(function(){
var href = $(this).attr('href');
if(hash==href.substr(0,href.length-4)){
var toLoad = hash+'.html #cont';
$('#cont').load(toLoad)
}
});
$('#links li a').click(function(){
var toLoad = $(this).attr('href')+' #cont';
$('#cont').hide('fast',loadContent);
$('#load').remove();
$('#wrap').append('<span id="load">LOADING...</span>');
$('#load').fadeIn('normal');
window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-4);
function loadContent() {
$('#cont').load(toLoad,'',showNewContent())
}
function showNewContent() {
$('#cont').show('fast',hideLoader('fast'));
}
function hideLoader() {
$('#load').fadeOut('normal');
}
return false;
});
});
And this is the CSS for my content div...
#cont {
overflow:auto ;
margin:0 auto ;
width:736px ;
height:341px ;
padding: 0 0 0 6px ;
}
Can anyone think of a reason for the extra scrollbars, or can anyone think of a workaround?
I'm using PHP include files to load my content...
<!DOCTYPE html>
<html>
<head>
<title>I.C.T - St. Patrick's Academy, Lisburn</title>
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<script type="text/javascript" src="assets/js/jq.js"></script>
<script type="text/javascript" src="assets/js/js.js"></script>
</head>
<body>
<div id="wrap">
<?php include("includes/head.php"); ?>
<div id="screen">
<div id="pad">
</div>
<?php include("includes/home.php"); ?>
</div>
</div>
</body>
</html>