I was just wondering if someone could give this a quick look and see
if there is anything wrong with it.  It seems to be working on the web
site but perhaps there is something I could do to make it more
efficient.

$(document).ready(function(){

  //THIS HIDES ALL LISTED DIVS ON LOADING OF PAGE
  $('div.blackbook').hide();
  $('div.canvas').hide();
  $('div.pencil').hide();
  $('div.murals').hide();
  $('div.shows').hide();
  $('div.tattoos').hide();
  $('div.miscellaneous').hide();

  $('a#blackbook').click(function() {
    //HIDE DIVS
    hide_divs();
    //SHOW LISTED DIV
    $('.blackbook').show('fast');
    return false;
  });

  $('a#canvas').click(function() {
    //HIDE DIVS
    hide_divs();
    //SHOW LISTED DIV
    $('.canvas').show('fast');
    return false;
  });

  $('a#pencil').click(function() {
    //HIDE DIVS
    hide_divs();
    //SHOW LISTED DIV
    $('.pencil').show('fast');
    return false;
  });

  $('a#murals').click(function() {
    //HIDE DIVS
    hide_divs();
    //SHOW LISTED DIV
    $('.murals').show('fast');
    return false;
  });

  $('a#shows').click(function() {
    //HIDE DIVS
    hide_divs();
    //SHOW LISTED DIV
    $('.shows').show('fast');
    return false;
  });

  $('a#tattoos').click(function() {
    //HIDE DIVS
    hide_divs();
    //SHOW LISTED DIV
    $('.tattoos').show('fast');
    return false;
  });

  $('a#miscellaneous').click(function() {
    //HIDE DIVS
    hide_divs();
    //SHOW LISTED DIV
    $('.miscellaneous').show('fast');
    return false;
  });

});

//HIDES ANY VISIBLE DIVS

hide_divs = function() {

    //HIDE ANY VISIBLE DIVS BEFORE CONTINUING
    if ($('div.main').is(':visible')) {
    $('div.main').hide('fast');
    }
    if ($('div.blackbook').is(':visible')) {
    $('div.blackbook').hide('fast');
    }
    if ($('div.canvas').is(':visible')) {
    $('div.canvas').hide('fast');
    }
    if ($('div.pencil').is(':visible')) {
    $('div.pencil').hide('fast');
    }
    if ($('div.murals').is(':visible')) {
    $('div.murals').hide('fast');
    }
    if ($('div.shows').is(':visible')) {
    $('div.shows').hide('fast');
    }
    if ($('div.tattoos').is(':visible')) {
    $('div.tattoos').hide('fast');
    }
    if ($('div.miscellaneous').is(':visible')) {
    $('div.miscellaneous').hide('fast');
    }
}

Any comments would be appreciated.

Reply via email to