Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8876087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:07:43+00:00 2026-06-14T19:07:43+00:00

I am using the following code (which I found elsewhere and am trying to

  • 0

I am using the following code (which I found elsewhere and am trying to modify to suit my needs) to create a div that slides from the right side onto my screen. How would I go about making it slide out when I click instead of hover? Thanks, in advance for your help.

jQuery(function($) {
$(document).ready(function() {
    $('#introbutton').hover(function() {
        $('#intro-container').stop(true, false).animate({
            'left': '0px'
        }, 900);
    }, function() {
        jQuery.noConflict();
    });

    jQuery('#introbutton').hover(function() {
        // Do nothing
    }, function() {

        jQuery.noConflict();
        jQuery('#intro-container').animate({
            left: '100%'
        }, 800);

    });
});
}); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:07:44+00:00Added an answer on June 14, 2026 at 7:07 pm

    Well, instead of using

     
     $('#introbutton').hover(function(){})
     
    

    use

     
      $('#introbutton').click(function(){})
     
    

    Of course, you have to realize that unlike hover, which returns back to its previous state, the div won’t return back to its original state after the click function has run. You might want to factor that into the overall solution.

    Hope this helps.

    Edit

    This code snippet resolves all the problem

     
    var is_show = true;
    jQuery(function($) {
      $(document).ready(function() {
        $("#introbutton").click(function(){return runFunction();});    
      });
    });
    
    
    function runFunction(){
        if (is_show){ //show div
            is_show = false;
            $('#intro-container').animate({
                'left': '0px'
            }, 900);       
        }
        else{ //hide div
            is_show = true;
            $('#intro-container').animate({
                'left': '100%'
            }, 800);         
        }
        return false;
    }
     
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following line of code to create a dictionary which stores
I am trying to use the .tooltip() that I found from the following: Jquery-ui
I'm using the following code to create an xls file from php. http://www.appservnetwork.com/modules.php?name=News&file=article&sid=8 However,
I am using the following code which I have found online def c_int_binary_search(seq,t): #
I am using the following code which i found on internet to call a
I'm using the following code which will generate a wav file which contains a
I am using the following code to determine which key is pressed by the
I have the following code which outputs an object to an XML file: using
I'm using he following code the call a CFC which returns auto-suggest results through
I'm using the following code to load some sounds depending on which button a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.