javascript - Overlay the content of html file into another html file -
javascript - Overlay the content of html file into another html file -
is there possibility of overlaying content of within html others.
for illustration have 2 html files in different folders in same root.
html1:
<section> <div class="html1"></div> <section>
html2:
<section> <div class="html2"></div> <section>
now on click of button need show content of html2 overlay , 1 time again on click of same button need hide html2.
can allow me know how accomplish this.
do not know why need this, can :-)
<input id="b" type="button" value="button" /> <section id="container" style="width:400px;height:200px;border:1px solid;font-family:verdana"></section> <script> var button = document.getelementbyid('b'); var section = document.getelementbyid('container'); var path = ['html_document1.html', 'html_document2.html']; //paths documents function fu() { var xml = new xmlhttprequest(); xml.addeventlistener('readystatechange', function () { if (this.readystate === 4 & this.status === 200) { section.innerhtml = this.response; } }, false); var shuffler = path.shift(); path.push(shuffler); xml.open('get', shuffler, true); xml.send(null); } window.addeventlistener('load', fu, false); button.addeventlistener('click', fu, false); </script>
javascript jquery html
Comments
Post a Comment