By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,385 Members | 1,889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,385 IT Pros & Developers. It's quick & easy.

How to hide a div found on another page when loading its content on part of a Main P

P: 1
So i have a main webpage which contains 3 links of other 3 webpages i created. When i click on for example link to PAGE 1, it loads the PAGE 1 within a <div id="article> on my main page:
<PAGE 1> <PAGE 2> <PAGE 3> <div id="article"> </div>
Now on my main webpage i assigned a toggle function to the div article and on the very page i used jquery to hide the article on load:

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. $(window).load(function() {
  3.  // executes when complete page is fully loaded, including all frames, objects and images
  4.  $("#article").hide();
  5. });    
  6. </script>
On Pages 1,2 and 3 there is just another div with id article as well and no script or css. So the logic is when i click on Page 1 link it loads the content within the div article there in the div article of this main page. The problem is since the on load function is for the whole window, the div is not hidden when i click on the Page 1 link. Is there a way to hide it when i click on page 1?
Apr 18 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.