简体   繁体   English

当我单击悬停菜单时,jquery 向上滑动功能不起作用

[英]jquery slide up function is not working when I click on the hover menu

I'm trying to create a hoverup menu.我正在尝试创建一个悬停菜单。 I tried writing a function in jquery, that on click of it, the hover menu should appear upwards.我尝试在 jquery 中编写一个函数,单击它时,悬停菜单应该向上显示。 But, it's not happening.但是,这不会发生。 The click function is not working at all.点击功能根本不起作用。 on click of it, the hover menu should come out.单击它,悬停菜单应该出来。 Will somebody help me to troubleshoot this issue.有人能帮我解决这个问题吗。 Thank You.谢谢你。

My Code Below:我的代码如下:

 $(document).ready(function () { $(".image-container").click(function(){ $(".dropup").fadeIn(); }); });
 .application-container{ position: relative; } /* The dropup container */ .dropup{ float: left; overflow: hidden; position: initial; display:none; } /* Dropup content (hidden by default) */ .dropup-content { width:100%; bottom:-100%; left:0%; position: absolute; background-color: #f9f9f9; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: -1; }
 <div class="container application-container"> <div class="row seven-rows"> <div class="column text-center image-container"> <img src="./images/aoe_icons_services_order_management.png" width='69' height='61' alt="e-commerce"> <p class="mt-2 text-custom">E Commerce</p> </div> <div class="dropup"> <div class="dropup-content pt-4 pb-4"> <div class="row"> <div class="col-lg-8 ml-5"> <h3> Innovative Omnichannel E-Commerce Solutions</h3> <p>AOE develops flexible and high-performance Enterprise E-Commerce portals. Our solutions digitize business processes and create efficient, profitable platforms for providers and customers.</p> <a class="btn btn-custom">E Commerce Solutions</a> </div> <div class="col-lg-4"> </div> </div> </div> </div> </div> </div> <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>

  • Remove display:none from content从内容中删除 display:none
  • Add diplay:none to dropup将 diplay:none 添加到 dropup
  • Use fadeIn使用淡入

 $(document).ready(function () { $(".image-container").click(function(){ $(".dropup").fadeIn(); }); });
 .application-container{ position: relative; } /* The dropup container */ .dropup{ float: left; overflow: hidden; position: initial; display:none } /* Dropup content (hidden by default) */ .dropup-content { width:100%; bottom:-100%; left:0%; position: absolute; background-color: #f9f9f9; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: -1; }
 <div class="container application-container"> <div class="row seven-rows"> <div class="column text-center image-container"> <img src="./images/aoe_icons_services_order_management.png" width='69' height='61' alt="e-commerce"> <p class="mt-2 text-custom">E Commerce</p> </div> <div class="dropup"> <div class="dropup-content pt-4 pb-4"> <div class="row"> <div class="col-lg-8 ml-5"> <h3> Innovative Omnichannel E-Commerce Solutions</h3> <p>AOE develops flexible and high-performance Enterprise E-Commerce portals. Our solutions digitize business processes and create efficient, profitable platforms for providers and customers.</p> <a class="btn btn-custom">E Commerce Solutions</a> </div> <div class="col-lg-4"> </div> </div> </div> </div> </div> </div> <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM