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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skyller
    New Member
    • Apr 2016
    • 1

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

    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:

    Code:
    <script type="text/javascript">
    $(window).load(function() {
     // executes when complete page is fully loaded, including all frames, objects and images
     $("#article").hide();
    });    
    </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?
    Last edited by Dormilich; Apr 18 '16, 07:04 AM. Reason: please use code tags
Working...