Also, if you put a reference to the div the navigation links are
targeting, like this:
<a href="#test1" id="test-click1">Previous Articles</a>
not only would you increase accessibility, but you could then
optimise your entire code down to just this:
$(function() {
$('#demo-show > div').hide();
$('#navigation a').click(function(){
$(this.hash).slideToggle('slow').siblings('div:visible').slideUp
('fast');
});
});
You could possibly (depending on if you need them for other reasons)
also remove the id from the nav links too.
Untested. If anyone sees an error, please point it out.
Joel.
On 23/02/2007, at 4:24 PM, Yansky wrote:
> This is my code:
> $(document).ready(function() {
> if ($('#demo-show > div').height() < 375)
> {$('#demo-show > div').height(375);}
>
> $('#demo-show > div').hide();
>
> $('#test-click1').click(function() {
> $('#test1').slideToggle('slow').siblings('div:visible').slideUp
> ('fast');
> });
>
> $('#test-click2').click(function() {
> $('#test2').slideToggle('slow').siblings('div:visible').slideUp
> ('fast');
> });
>
> $('#test-click3').click(function() {
> $('#test3').slideToggle('slow').siblings('div:visible').slideUp
> ('fast');
> });
> });
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/