当用户点击但似乎不奏效时,我试图改变案文。
http://jsfiddle.net/3jt3P/1/“rel=“nofollow” http://jsfiddle.net/3jt3P/1/。
<a href="#" class="slide" onclick="firstclick();">Show First</a> ...
<a href="#" class="slide1" onclick="secondclick();">Show Second</a>
<div id="one" class="content">one</div>
<div id="second" class="content">two</div>
<script type="text/javascript">
function firstclick() {
$( #second ).hide();
$( #one ).slideToggle(400, function () {
debugger
if ($(this).is(":visible")) {
$( .slide > a ).text( Hide First );
$( .slide1 > a ).text( Second );
}
else {
$( .slide > a ).text( First );
}
});
return false;
}
function secondclick() {
$( #one ).hide();
$( #second ).slideToggle(400, function () {
if ($(this).is(":visible")) {
$( slide1 > a ).text( Hide Second );
$( slide > a ).text( First );
}
else
$( slide1 > a ).text( First );
});
return false;
}
$(document).ready(function () {
// Hide the "view" div.
$( #one ).hide();
$( #second ).hide();
});
</script>