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

  • Home
  • SEARCH
  • 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 9078019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:30:59+00:00 2026-06-16T19:30:59+00:00

I have a <div> dynamically created and I am trying to put in a

  • 0

I have a <div> dynamically created and I am trying to put in a FadeIn FadeOut effect. However, when the PostBack occurs, these Jquery effects stop working. When the page is loaded, everything works fine, but if a postback occurs, they stop.

Creating DIV Dynamically

protected string CarregaLista()
{
    int credenciada_Id = Convert.ToInt32(tk.CarregaToken(1, Request.Cookies["token"].Value));
    int celula_Id = Convert.ToInt32(tk.CarregaToken(21, Request.Cookies["token"].Value));

    string select = "My Select";

    SqlConnection c = new SqlConnection(con.Con);
    SqlCommand cmd = new SqlCommand(select, c);
    c.Open();

    try
    {
        SqlDataReader r = cmd.ExecuteReader();
        montaTabela += "<ul id='sortable' class='" + cont + "' style='margin: 0 15px 15px !important; width: 637px !important;'>";

        while (r.Read())
        {   
            montaTabela += "<li class='ui-state-default linhaImovel' style='color:#777 !important;' id='" + r["Imovel_Id"].ToString() + "'>";                    
            montaTabela += "<span class='ui-icon ui-icon-arrowthick-2-n-s'></span>";

            montaTabela += "<div class='btn btn-mini btn-netimoveis botaoExcluir' style='float: right !important;' id='excluirDestaque_" + r["Imovel_id"].ToString() + "' OnClick='excluirDestaque(" + r["Imovel_Id"].ToString() + ")'><i class='icon-trash icon-white'></i>Excluir</div>";

            montaTabela += "<table>"; 
            montaTabela += "    <tr>"; 
            montaTabela += "        <td>";
            montaTabela += "            <img src='" + url + "' width='110' height='81' />"; 
            montaTabela += "        </td>";
            montaTabela += "        <td style='padding-left: 20px !important; padding-right: 20px !important; width: 111px !important;'>COD: " + r["Imovel_Id"].ToString() + "<br />" + r["TipoDsc1"].ToString();
            montaTabela += "        </td>";
            montaTabela += "        <td style='border-left: 1px dotted #CCC; padding-left: 20px !important; padding-right: 20px !important; width: 111px !important;'>" + r["BairroDsc1"].ToString(); 
            montaTabela += "        </td>";
            montaTabela += "        <td style='border-left: 1px dotted #CCC; padding-left: 20px !important; padding-right: 20px !important; width: 111px !important;'>R$ " + r["ValorImovel"].ToString(); 
            montaTabela += "        </td>";
            montaTabela += "        <td>";
            montaTabela += "            <span class='badge badge-warning'></span>";
            montaTabela += "        </td>";
            montaTabela += "    </tr>";
            montaTabela += "</table>";                    
            montaTabela += "</li>"; 
        }

        montaTabela += "</ul>";
        return montaTabela;
    }
    catch (Exception e)
    {
        return montaTabela;
    }
}

Trying to put the Effect via JQuery

$(function () {            
            $(".linhaImovel").mouseenter(function () {
                $(this).find(".botaoExcluir").fadeIn();
            }).mouseleave(function () {
                $(this).find(".botaoExcluir").fadeOut();
           });
});
  • 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-16T19:31:01+00:00Added an answer on June 16, 2026 at 7:31 pm

    If you replace the elements the event handlers are no longer bound to the new ones (because they’re completely new, separate elements), even if they match the criteria when you originally executed the code to bind them. You’ll need to use event delegation:

    $(document).on({
         mouseenter: function(e) {
             $(this).find(".botaoExcluir").fadeIn();
         },
         mouseleave: function(e) {
             $(this).find(".botaoExcluir").fadeOut();
         }
    }, '.linhaImovel');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form dynamically created using Jquery and i am trying to validate
I have dynamically created the buttons in a div. And binding the click and
I'm trying to dynamically create a div to show error messages using jquery. I'm
I am trying to append text to a div which has been dynamically created.
I'm trying to hide some divs that I have created dynamically using the .hide()
I have some code dynamically created by Sigma, which looks like this: <div id=myGrid1_headDiv
I have created a form with a dynamically created field and i am trying
I have an input type-text that is created dynamically via asp.net after a div
I have a div with ID 'adpictureholder', to which I dynamically add (or remove)
I have a scrollable div element with a number of checkboxes dynamically generated. I

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.