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 8857979
In Process

The Archive Base Latest Questions

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

I have the below code that is animating a div (#feedback-form-container) to slide in

  • 0

I have the below code that is animating a div (#feedback-form-container) to slide in and out and when clicked it jumps to the center of the screen and then these slide animations are turned off. Once the form in the div is submitted and the form goes back to where it was I want to turn these animations back on again however this is not working. I am trying to use on() for this without success. Can anybody spot the problem? I’m stumped.

/////////////////////feedback form animation//////////////////////
jQuery(document).ready(function($) {
  //find center of screen
  var $screenwidth = $(window).width();
  var $screencenter = $screenwidth / 2 - 177;
  var $startpos = $screencenter + 260;
  var overlay = jQuery('<div id="simpleoverlay"> </div>');

  //hover to slide functions
  $('div#feedback-form-container').hover(function() {
    $('div#feedback-form-container').animate({
      left: '+=260px'
    },
    '2000');
  },

  function() {
    $('div#feedback-form-container').animate({
      left: '-=260px'
    },
    '6000');

  });
  //click to slide to center of screen
  $('div#feedback-form-container').click(function() {
    $('div#feedback-form-container').animate({
      left: '+=' + $screencenter
    },
    {
      duration: '2000',
      easing: 'swing',
      complete: setTimeout(function() {
        overlay.appendTo(document.body)
      },
      500)
    });

    //unbind functions
    if ($('div#feedback-form-container').is(':animated')) $('div#feedback-form-container').off('click').off('hover');
    //set cursor back to default
    $('div#feedback-form-container').css('cursor', 'default');

  });

  $('#wpcf7-f52-t1-o1').submit(function() {

    $('div#feedback-form-container').animate({
      left: '-=' + $startpos
    },
    '6000');

    $('div#feedback-form-container').on('hover').on('click');
  });
  • 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-14T14:43:16+00:00Added an answer on June 14, 2026 at 2:43 pm

    The on and off methods are not used to turn events on and off, despite the somwhat confusing names. The on method is used to bind events, and the off method is used to unbind events.

    When you unbind an event, it’s gone from the element. To use the event again you have to bind it again, and for that you have to specify what event handler you want to use for it. It’s not enough to just specify the event, because the element doesn’t remember the event handler from before.

    Using .click(func) has the same effect as using .on('click', func).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the code below on form so that the user submits the form
I have code that looks more or less like the code below but it
I have the code below that hides and shows the navigational bar. It is
I have this javascript code below that uses jquery, it is suppoed to be
below i have a code that runs in most of my simple programs ..
I have a piece of code (below) that can get the text of an
Background: I have a WPF UserControl (MainControl - not shown in code below) that
I have the code below. I'm wondering that does the self.value and _value have
I have a plot (sample code pasted below) that I am trying to add
The code below works great. I have a MySQL database that contains book titles

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.