I have 2 external html file (header and footer),
that I load with this code:
<div id="header-div"></div>
<div id="footer-div"></div>
$(function () {
$("#header-div").load("/AfekDent/header.html");
$("#footer-div").load("/AfekDent/footer.html");
});
the header file include javascript code that isn't working..
function switchClass(i) {
var lis = $('#home-news > div');
lis.eq(i).removeClass('home_header_on');
lis.eq(i).removeClass('home_header_out');
lis.eq(i = '++i' % lis.length).addClass('home_header_on');
lis.eq(i = '++i' % lis.length).addClass('home_header_out');
setTimeout(function () {
switchClass(i);
}, 3500);
}
$(window).load(function () {
switchClass(-1);
});
what is the problem?
<script>tags? Can you give us a complete exanple of the header and footer, please?.htmlor.htm