JavaScript hover effect creates flickering

I am trying to display options on an image on hover but when I hover the displayed options keeps flickering

      $('a').hover(function(event) {
        var href = $(this).attr('href');
        var top = $(this).next().css("bottom");

            $(this).next().css("display", "block");
            $(this).next().next().css({ 'top': '30px', 'display': 'block' });

    },function() {
            $(this).next().hide();
            $(this).next().next().hide();

    });

});
$('.SelectionAnimate').hover(function() { $(this).css("display", "block"); $(this).next().show(); });

the listview code

           <ItemTemplate>
            <div style="float: left; position: relative; margin: 10px;" >
                <div>
                    <a class="real" target='_blank' href='<%#"/ProfileTenModified/UserProfile/PhotoCross.aspx?in="+ Eval("Full_Image_Name") +"&mi=" + Eval("User_Id") +"&fd="+ Eval("Album")%>'>
                        <asp:Image ID="Image1" runat="server" ImageUrl='<%#"/ProfileTenModified/setP/"+ Eval("Slide_Thumb_Name") +".JPEG" %>'
                            BorderStyle="Solid" BorderWidth="1px" Width="172px" Height="172px" />
                    </a>
                    <asp:LinkButton CssClass="SelectionAnimate" ID="Selection" runat="server" Text="Set as Display"
                        OnCommand="ListViewThums_Selection_Command" CommandName="selection"></asp:LinkButton>
                    <asp:LinkButton CssClass="SelectionAnimate" ID="Deletion" runat="server" Text="Remove"
                        OnCommand="ListViewThumbs_Command"></asp:LinkButton>
                </div>
                <asp:HiddenField ID="HiddenFieldImageId" runat="server" Value='<%#Eval("Id") %>' />
            </div>
        </ItemTemplate>

I used both the mouseenter and hover both create the same effect. is there away to solve this

Answer:1

You apply .hover() on the a only. So when you hover the a, the image appear hover your a wich mean you are not hover the a anymore. That will fire the second callback of .hover() and the image will disappear. Then again you are hover the a and it repeat infinitly.

To solve that, you just have to bind the .hover() on the parent container or on both elements.

Answer:2

I have been trying to toggle the background-color property of a button onclick but the color only changes once and does not toggle back and forth. Below is the code. function btnColor(btn, color) { ...

I have been trying to toggle the background-color property of a button onclick but the color only changes once and does not toggle back and forth. Below is the code. function btnColor(btn, color) { ...

  1. button background color css
  2. button background color android
  3. button background color react native
  4. button background color transparent
  5. button background color swift
  6. button background color tkinter
  7. button background color kivy
  8. button background color bootstrap
  9. button background color javafx
  10. button background color swiftui
  11. button background color opacity
  12. button background color material ui
  13. button background color android studio
  14. button background color none
  15. button background color not working
  16. button background color java
  17. button background color xcode
  18. button background color on hover
  19. button background color in html
  20. button background color javascript

I have looked for possible roots of my issue but have been unable to do so. I have some java Script that dynamically creates a list of check boxes. Some have text other have anchor links with text ...

I have looked for possible roots of my issue but have been unable to do so. I have some java Script that dynamically creates a list of check boxes. Some have text other have anchor links with text ...

  1. checkbox text not visible c#

I am simply calling as window.location = '../MyController/MyAction?campId=' + campId + '&campName=' + campName; and in action am receiving it as [HttpGet] public ActionResult MyAction(int ...

I am simply calling as window.location = '../MyController/MyAction?campId=' + campId + '&campName=' + campName; and in action am receiving it as [HttpGet] public ActionResult MyAction(int ...

  1. parameter value missing for '-top'
  2. parameter missing value ssrs
  3. invalid_parameter_value missing required field size
  4. xst - parameter value missing for '-top'
  5. parameter is missing value
  6. required parameter 'value' is missing for event 'purchase'
  7. missing parameter value of type interface org.gradle.logging.styledtextoutputfactory
  8. missing parameter value for aura.tag
  9. missing parameter value of type interface org.gradle.internal.factory
  10. missing parameter value in crystal report
  11. report viewer parameter missing value
  12. ssrs hidden parameter missing value
  13. a parameter value is missing from the subscription
  14. missing parameter value error in crystal report

this is similar to my last question. sorry I don't know whether i could edit the same question. so here is my requirement. my HTML has the following part <ul class="products-grid"> <li ...

this is similar to my last question. sorry I don't know whether i could edit the same question. so here is my requirement. my HTML has the following part <ul class="products-grid"> <li ...