1
你好,我希望#accordion如果打開,則消除200px的邊距,如果關閉,則插入200px的邊距。 當打開時,我已經在點擊h3上連接了對功能的消除。 #accordion關閉時如何插入邊距?手風琴動畫jquery
鏈接temporany頁:http://www.davidxdesign.altervista.org/city.htm
<script>
$(function() {
var stop = false;
$("#accordion h3").click(function(event){
if (stop)
{ event.stopImmediatePropagation();
event.preventDefault(); stop = false } });
$("#accordion").accordion({
header: "> div > h3",
collapsible: true,
active: false,
autoHeight: false,
changestart: function(event, ui){ ui.newHeader.parent().prependTo(this); } })
.sortable({
axis: "y",
handle: "h3",
stop: function() { stop = true; } }) });
</script>
<script>
function zeromargindiv(){
$('#accordion').animate({
marginTop: '0px' },
2000, function() { }); }
</script>**
<div id="accordion" style="margin-top:180px">
<div class="group">
<h3 onclick="zeromargindiv()">Cosa Visitare</h3>
<div>
</br>
<a onclick="go('map/duomo.htm')">Via del Duomo</a> </br>
<a onclick="go('map/cavour.htm')">Corso Cavour</a> </br>
<a onclick="go('map/palcapitano.htm')">Palazzo del Capitano del Popolo</a> </br>
<a >Palazzo Comunale</a> </br>
<a >Vicolo degli Artisti</a> </br>
<a href="http://www.baduel.it" target="_blank" >Libreria antiquaria Baduel</a> </br>
<a href="http://www.bibliotecaorvieto.it/easyne2/LYT.aspx?IDLYT=8892&ST=SQL&SQL=ID_Documento=30&CODE=FUMI" target="_blank" >Biblioteca Fiumi</a> </br></br>
</div>
</div>
etc...
THX是好的,但不是當點擊另一類別!只有當所有類別都關閉時! – Dabidx88 2013-02-27 09:38:43
查看更新的代碼和鏈接.. – 2013-02-27 09:46:42
你是最棒的!謝謝 – Dabidx88 2013-02-27 09:57:45