My script works great, but I don't know why the link has to be above
the toggle content. Is it possible to place the link beneath the DIV
I want to hide and show. Right the script only works if the link is
above.
My intent is to have independent DIV's that toogle... It works, but I
need the links below the DIV.
Any suggestions?
Very grateful.
Erik
HEREE IS MY CODE:
<!DOCTYPE html>
<html dir="ltr" lang="en-CA">
<body>
<div class="SomeOtherClass">
Foo <a class="SomeClass" href="#">More Details</a>
<a class="SomeClass" href="#">More Details</a>
<div class="SomeOtherClass">
foo </div>
<a class="SomeClass" href="#">More Details</a>
<div class="SomeOtherClass">
foo </div>
</div>
</body>
<script src="/src/js/jquery/core/jquery-1.3.2.min.js" type="text/
javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{
$('.SomeOtherClass').hide();
$('a.SomeClass').click(function()
{
$(this).next('div.SomeOtherClass').slideToggle(400);
$(this).text($(this).text() == 'More Details' ?
'Close' : 'More Details');
return false;
});
});
</script>
</html>
No comments:
Post a Comment