스크립트로 인해로드 된 내용에 따라 내 페이지의 컨텐츠 div를 확장하려고합니다. 나는 내가 아는 모든 것과 내가 인터넷에서 발견 한 모든 것을 시도했지만, 나는 원하는 결과를 얻지 못했다.내용에 따라 div를 확장하십시오.
HTML :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>index</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function(){
$('#nav a').click(function(e) {
$('#content').hide().load($(this).attr('href') , function(){
$('#content').show()
})
return false
})
})
</script>
</head>
<body>
<div id="container">
<div id="header"></div>
<div id="nav"><a href="home.html">Home</a>
<a href="the_band.html">The Band</a>  
<a href="News.html">News</a>  
<a href="gallery.html">Gallery</a> Merchandise
<a href="contact.html">Contact</a></div>
<div id="content"></div>
<div id="footer"></div>
</div>
</body>
</html>
CSS :
div#container {
height: 100%;
width: 100%;
}
div#header {
top: 0px;
width: 100%;
height: 80px;
position: fixed;
background-color: transparent;
text-align: center;
}
div#nav {
font-family: MgSouvenirLight;
font-size: 18pt;
color: #FF0;
top: 120px;
width: 100%;
height: 40px;
position: fixed;
text-decoration: none;
text-align: center;
font-weight: bolder;
font-variant: normal;
}
div#content {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 12px;
position: absolute;
top: 200px;
bottom: 40px;
left: 200px;
right: 200px;
}
div#footer {
font-family: Arial, Helvetica, sans-serif;
font-size: 9px;
bottom: 0px;
position: fixed;
height: 30px;
width: 100%;
text-align: center;
color: #fff;
}
.ttdesign {
font:"Arial Black", Gadget, sans-serif; color: #09F;
}
a:link {
font-family: MgSouvenirLight;
font-size: 18pt;
color: #FF0;
}
a:visited {
font-family: MgSouvenirLight;
font-size: 18pt;
color: #FF0;
}
a:hover {
font-family: MgSouvenirLight;
font-size: 18pt;
font-style: italic;
color: #FC0;
}
데모 링크는 다음과 같습니다 http://thodoris.esy.es/is/
지금 발생하는 문제는로드 된 내용이 없다는 것입니다 #content를 펼치지 만로드가 넘는 것 같습니다. 어떤 아이디어가 있습니까?
here이 페이지에로드되는 방법을 보여주는 몇 가지 무료 템플릿이 있습니다 얻을 수 ...? –
내용이 비어 있습니다. –
$ ('# content'). ($ (this)) .attr ('href'), function() {$ ('# content'). '아무 것도로드하지 않고 .. '
' –