<script type="text/javascript">
var button = document.getElementById("button");
var idTab5 = document.getElementById("idTab5");
var button2 = document.getElementById("button2");
function showwMore() {
button.style.display="none";
idTab5.style="overflow:hidden;display:block;height:100%;font-size:12px;line-height:14px;";
button2.style.display="block";
}
function showwLess() {
button2.style.display="none";
idTab5.style="overflow:hidden;height:250px;font-size:12px;line-height:14px;";
button.style.display="block";
}
</script>
,这是其他代码:的Javascript:上按钮改变股利大小单击
{if $product->description|count_characters:true > 350 }
{* full description *}
<div id="idTab5" style="overflow:hidden;height:250px;font-size:12px;line-height:14px;">{$product->description}</div>
<input id="button" type="button" style="margin-top:5px;font-size:12px;color:white; width:120px;background:#4e3248;border:none;height:30px;border-radius:5px;" value="Mostrar +" onclick="showwMore()">
<input id="button2" type="button" style="margin-top:5px;display:none;font-size:12px;color:white; width:120px;background:#4e3248;border:none;height:30px;border-radius:5px;" value="Mostrar -" onclick="showwLess()">
{else}
<div id="idTab5" style="overflow:hidden;height:250px;font-size:12px;line-height:14px;">{$product->description}</div>
{/if}
现在它似乎没什么问题,但的onclick,股利心不是越来越大,任何想法,为什么会出现这种情况?香港专业教育学院多次检查代码无法找出为什么它不工作,我错过了什么?
你一定是在跟我开玩笑,在开始我的代码正在工作,突然它停止工作..现在改变刚才你建议再工作...... jeez,非常感谢。 – user1738483
你有什么想法如何实现一个小小的CSS动画,因此该div不会变得更快? – user1738483
它http://stackoverflow.com/questions/15768242/trying-to-use-basic-javascript-to-animate-a-div-and-make-it-bigger-but-have-it-g给出了一些上下文给你。 –