我在我的网站中有一个时间线功能,在某一年文本可能非常长,有些可能只有1行,我想调整页面大小,以便当用户在下一年点击该页面并非真的很长,只有一行?如何在jQuery中调整ul,div p
IM使用timeliner JS从 http://www.csslab.cl/ejemplos/timelinr/latest/js/jquery.timelinr-0.9.5.js
<ul id="dates">
<li><a href="#1940s">1940s</a></li>
<li><a href="#1950s">1950s</a></li>
</ul>
<ul id="issues">
<li id="1940s"><img src="/timeline/1950.jpg" />
<h1>1940's</h1>
<p>RonaldertreRonaldertreRonaldertrevRonaldertre Ronaldertre RonaldertreRonaldertre Ronaldertre Ronaldertre Ronaldertre Ronaldertre Ronaldertre Ronaldertre Ronaldertre vkv RonaldertreRonaldertre kRonaldertre Ronaldertre Ronaldertre Ronaldertre Ronaldertrekv Ronaldertre RonaldertreRonaldertre Ronald “Eddy” Edmonson a qualified architect and surveyor joined the Royal Artillery in WW2. At the end of vre RonaldertreRonaldertre Ronald “Eddy&rdquoWar he found himself stationed in Turin, and became interested in a nearby factory where the Germans held early experiments in plastic injection moulding. After being re RonaldertreRonaldertre Ronald “Eddy” Edmonson a qualified architect and surveyor joined the Royal Artillery in WW2. At the end of the War he found himself stationed in Turin, and became interested in a nearby factory where the Germans held early experiments in plastic injection moulding. After being re RonaldertreRonaldertre Ronald “Eddy” Edmonson a qualified architect and surveyor joined the Royal Artillery in WW2. At the end of the War he found himself stationed in Turin, and became interested in a nearby factory where the Germans held early experiments in plastic injection moulding. After being the War he found himself stationed in Turin, and became interested in a nearby factory where the Germans held early experiments in plastic injection moulding. After being Demobbed back at home, Eddy took this interest further and on 18th October 1946 set up plastic moulding company, Plastiers Limited (Lewisham). He is pictured (right) manning his first commercial production run! RonaldertreRonaldertreRonaldertreRonaldertreRonaldertrevRonaldertreRonaldertre test test test.</p>
</li>
<li id="1950s"><img src="/timeline/1960.jpg" />
<h1>1950's</h1>
<p>Eddy.</p>
</li>
</li>
</ul>
实施例这里:
http://jsfiddle.net/uzi002/sEFQS/1/
编辑:
jquery的IVE尝试:
$("#dates li a").click(function() {
$('#issues').css("height", $("#" + $(this).html()).height());
});
武汉理工大学,这个问题确实是模糊的... – Phil 2012-03-23 14:32:58
我如何调整页面的高度作为文本的变化当你沿着时间轴 – Beginner 2012-03-23 14:36:30