If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member djsquid's Avatar
    Join Date
    Aug 2011
    Member #
    Hey Guys,

    is it possible to have 2 Jquery events run on the same button?

    for example I want my home page to fade to about 50% opacity when I click on #cat to open the navigation menu, but I also want to bring the opacity back to 100% if I were to click on #cat again? or any of the other nav buttons.

    I tried;

    $('#cat').click(function() {
        $('.homepage,').fadeTo(500, 0.5);
        return false;
    $('#cat').click(function() {
        $('.homepage,').fadeTo(500, 1.0);
        return false;

    It changes it to 50% but then instantly changes back to 100% so I'm thinking this is a little more complicated then I can do right now, so any help would be great!

    I have read about .bind and .one but I'm not sure.....still an amateur


  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Oklahoma City
    Member #
    959 times
    Well, again, amateur here, but could you change the class in the first function, then target that class in the second function? Then just change it back when you're done?
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 02:16 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: