我编写了一个jQuery函数,用于在点击div#quotecontact中的'NEXT'链接时用另一个id为quotenext的div替换id为quotecontact的div的内容。它工作正常。但我有一个'返回'链接在我的div#quotenext需要链接到quotecontact div但它不起作用。我会把我的代码放在下面,让我知道我错在哪里。如何替换另一个div内容,然后能够检索第一个div的内容?
<div class="slidingDiv">
<div id="quotecontact" style="display:none >
<a href="#" class="nextquote" data-target="quotenext" style="color:#000;font-size:19px">
NEXT
</a>
</div>
<div id="quotenext" style="display:none;">
<a href="#" class="nextquote" data-target="quotecontact" style="color:#000;font-size:19px">
< BACK
</a>
</div>
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(".nextquote").click(function(e) {
e.preventDefault();
$j(".slidingDiv").html($j("#"+$j(this).data('target')).html());
$j(".slidingDiv").show("slide", {
direction: "right"
}, 200);
});
});
</script>
您的问题没有解决? – PSL 2013-05-06 03:30:56