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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:52:20+00:00 2026-05-31T02:52:20+00:00

I want to bind an element with a function via live() method. The function

  • 0

I want to bind an element with a function via live() method.
The function excecutes just fine only for the first time.
I think that I have to unbind this element from any events and rebound the same function but I don’t know how to do it!

Here is the code:

var temp = function() {
    var htmlEx = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";

    $('#template_loading').fadeIn();
    $('#template_loading').queue(function() {
        $('#tp_prev').html(htmlEx);
        $('#template_container').removeClass("cur_temp");
        $('#template_container').addClass("cur_prev");
        $('#template_container').animate({"margin-left" : "0"}, 400, 'easeOutExpo');    
        $('#template_container').queue(function() {
            $('#template_loading').fadeOut();               
            $('#tp_cur').empty();               
            $('#template_container').removeClass("cur_prev");
            $('#template_container').addClass("cur_temp");  
            $('#tp_prev').empty();              
            $('#tp_cur').html(htmlEx);
            $('#tp_cur').queue(function() {
                $('#prev.pers_arrow').die();
                $('#prev.pers_arrow').live("click", temp);
                $(this).dequeue();
            });
            $(this).dequeue();
        });
        $(this).dequeue();
    });
};

$('#prev.pers_arrow').live("click", temp); 
  • 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-05-31T02:52:21+00:00Added an answer on May 31, 2026 at 2:52 am

    the first: NEVER, EVER, EVER do like that.

    You have to cache your data and don’t jump all time into the dom!!!

    second:
    in my opinion live is deprecated -so you can use on and off

    try that:

    var prev=$("#prev");
    var pers_arrow=".pers_arrow";
        var temp = function() {
        var htmlEx = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
        var template_loading=$('#template_loading');
    
        template_loading
            .fadeIn()
            .queue(function() {
                $('#tp_prev').html(htmlEx);
                var template_container=$('#template_container');
                template_container
                    .removeClass("cur_temp")
                    .addClass("cur_prev")
                    .animate({"margin-left" : "0"}, 400, 'easeOutExpo')
                    .queue(function() {
                        template_loading.fadeOut();               
    
                        template_container.removeClass("cur_prev").addClass("cur_temp");  
                        $('#tp_prev').empty();    
                        //you can don't use it - because .html() method already will clean container         
                        //$('#tp_cur').empty();      
                        $('#tp_cur').html(htmlEx).queue(function() {
                            prev.off("click",pers_arrow,temp).on("click",pers_arrow,temp);
                            $(this).dequeue();
                        });
                        $(this).dequeue();
                    });
                $(this).dequeue();
            });
    };
    prev.off("click",pers_arrow,temp).on("click",pers_arrow,temp)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to bind a click event with the element: $('a').click(function(){ btn_submit_pressed=false; }); Now,
i have an input element, and i want bind both change and keypress event
Using jQuery I want to bind an existing function to a button. I've been
I have a datasource that I want to bind to a listview that has
I want to bind an onclick event to an element I insert dynamically with
I have a function in jQuery and I want that where that function is
I think this should be simple. Say I've got the following jQuery: $someForm.live('submit', function(event)
i create custom multiple span element and bind with with click event. i want
I am inlining an external svg that has a text element. I want the
Here's the HTML that my browser sees. I want to hide the div.embed element:

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.