Please help completing this slider code I am stuck.
Hello,
I am makeing this neat slider. You click the links and the slider comes out but when I click the same link twice it comes back. I need to not have it move when it is clicked twice. For a better I dea of what I need Take a look at my code: and here is a site that has the effect that I want in flash(I know this is j query and not flash this is just an example:http://artistecard.com/JBoog
<script>
$(function () {
var current
$("#aOne").click(function () {
trade($("#div1"));
});
$("#aTwo").click(function () {
trade($("#div2"));
});
$("#aThree").click(function () {
trade($("#div3"));
});
var trade = function (el) {
$(".current").animate({ left: -400 }, 2000, "linear",
function () {
$(this).css("left", "4000px").removeClass("current");
});
el.addClass("current");
el.animate({
left: 150
}, 1000);
}
});
</script>
</head>
<body>
<div><a id="aOne" href="#">Div One</a><a id="aTwo" href="#">Div Two</a><a id="aThree" href="#">Div Three</a></div>
<div class="slider"
style="position:absolute;width:150px;height:150px; top:150px;left:4000px;background- color:#EEE;" id="div1" >
First Div
</div>
<div class="slider"
style="position:absolute;width:150px;height:150px; top:150px;left:4000px;background- color:#AAA" id="div2" >
Second Div
</div>
<div class="slider"
style="position:absolute;width:150px;height:150px; top:150px;left:4000px;background- color:#555" id="div3" >
Third Div
</div>
</body>
Thank you.