Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have two div on page with more images on it. i want if i click on div2 it should hid the content of div1 and show the content of div2 .but if i click anywhere else on the page it should hide the content of div1..on click of div2 only it should the content of div1.

Div1 = hm_cnt
Div2=container_bottom

here is code...
ASP.NET
<form id="form2"  runat="server">
  <div id="bg"> <img src="Images/wall3.jpg"></div>
  <section id="home">
    <div id="hm_cnt"  runat="server">
      <h1>TURNKEY MANAGED PRINT SERVICES PROVIDER</h1>
      <p>"Cartridge Junction (India) Pvt. Ltd. is a Provider of a High end Managed Print Solution  (MPS)  since 2008 Pan India. Our solution is currently being offered across 4,000 locations in all 29 states and 7 Union Territories. <br />
        We effectively reduce print costs by up to 70% for Corporates by customizing solutions that are the best fit for each customer based on their existing Printer Fleet, their user requirements and the best in Print Solutions available in the market.<br />
        Our Brand independent MPS model, with a massive footprint across India, can take the complete pain out of managing a diverse Printer fleet.</p>
      <span><b style="color:#d23735; font:bold 20px/22px futura-mediumregular;">We have been profiled by GARTNER as a "Cool Vendor" globally in 2010 and 2013 in the Imaging Industry.</b><br />
      <br />
      To understand the finer aspects of our solution, kindly click on the links below.lt;/em> </a></div>
        <div class="clr"></div>
      
    </article>
    <div class="clr"></div>
  </section>
</form>


And jquery code is here:-
JavaScript
<script type="text/javascript">
    $(document).ready(function () {
        $("#container_bottom").click(function (e) {
            if (e.target == '#container_bottom' && e.target != '#hm_cnt') {
                $("#hm_cnt").hide('slow');
            }
        });
    });
        </script> 
lt;/em> </a></div>
        <div class="clr"></div>
      
    </article>
    <div class="clr"></div>
  </section>

Plz revert on urgent basis
Posted
Updated 17-Aug-15 0:35am
v3
Comments
Andy Lanng 17-Aug-15 6:36am    
Please remember that this site used html encoding for posts. You have to encode the html between 'pre' tags or we can't see the markup
xszaboj 17-Aug-15 10:55am    
there is no container_bottom in your code....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900