这是我的代码
查询
//Hide/Show Audio Player
$(document).ready(function()
{
var $button = $("#hs-nav");
var $navbar = $("#nav-column");
$navbar.animate();
$button.toggle(
function()
{
$("#nav-column").hide();
document.getElementById("screen-column").style.left = "0";
},
function()
{
$("#nav-column").show();
document.getElementById("screen-column").style.left = "";
});
});
这是我的 HTML
<div id="hs-nav">
<a href="#" ><img src="images/left-arrow.png" width="20" height="20" alt=""></a>
</div>
我希望切换按钮在单击时适当地在左箭头和右箭头之间切换。我到处寻找,任何帮助将不胜感激!
我试过了,但它不起作用
$(document).ready(function()
{
var $button = $("#hs-nav");
var $navbar = $("#nav-column");
$navbar.animate();
$button.toggle(
function()
{
$("#nav-column").hide();
document.getElementById("screen-column").style.left = "0";
document.getElementById("hs-nav").addClass("right-arrow");
},
function()
{
$("#nav-column").show();
document.getElementById("screen-column").style.left = "";
document.getElementById("hs-nav").removeClass("right-arrow");
});
});