

HTML5 loading a section & lt; & Gt; contained in a main view envelope?
source link: https://www.codesd.com/item/html5-loading-a-section-contained-in-a-main-view-envelope.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

HTML5 loading a section & lt; & Gt; contained in a main view envelope?
I am no stranger to front-end development, but I have come across a requirement by a client which I have never done before, and I would appreciate it if someone can point me into the right direction.
I have 7 <section>
tags within my index.html. Each section represents one of the site navigation link. so "Home" link will show "home section" and so on. And the requested section gets populated in the main-content view/wrapper.
Usually, I will employ a MVC framework to get this functionality going. However, I am asked not to implement MVC. My thoughts were to find out which navigation link was clicked and then load the particular section into the main-content-wrapper.
How can I make this happened so that main-content-wrapper's height is adjusted accordingly, and there is a browser scroll bar if needed? Because some sections have a lenghty content.
By the way, main-content-wrapper' overflow has been set to 'auto'.
If you're populating all the section
-s on your page you can try this - http://jsfiddle.net/Fyhm7/
HTML
<a href="#" data-section="#home">Home</a>
<a href="#" data-section="#products">Products</a>
<a href="#" data-section="#contact">Contact</a>
<section id="home">Home</section>
<section id="products">Products</section>
<section id="contact">Contact</section>
JS
$("a").on("click", function() {
var id = $(this).data("section");
$("section:visible").fadeOut(function() {
$(id).fadeIn();
});
});
Recommend
-
13
Review: Harber London Magnetic Envelope Sleeve for iPad Pro
-
36
This sample web application uses DayPilot JavaScript Scheduler. It is based on the HTML5 scheduler tutorial.Features
-
9
Back-of-the-envelope calculation From Wikipedia, the free encyclopedia Jump to navigation
-
14
Apple 'pushes the envelope' with iPad Pro say executives ...
-
9
Shanghai to distribute USD3 million worth of digital yuan through red envelopeShanghai to distribute USD3 million worth of digital yuan through red envelope June 4, 2021 9:25 pm China is pushing forward its digital yuan trails with th...
-
24
Ahana CEO Steven Mih pushes the envelope on cloud open data lake analytics
-
5
TSC envelope specification targets better data transactions on BSV Tech 5 hours ago...
-
8
What does it mean to push the envelope? Pushing the envelope is a phrase used to mean to move past the limits of what has already been done or whatever is th...
-
7
Loading different HTML pages in a main HTML page using HTML5 Websockets advertisements i have a situation where i want to l...
-
4
Jaws scripts for the HTML5 `main` element17 November 2012Сообщение для российских читателейUpdated on 1 November 2018: Jaws scripts no longer available. A shortcut ("q") for moving directly to the
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK