I am building a site that accompanies a presentation. I have been asked if the site content can be tailored according to what is presented, i.e. remove some elements on the page. So I have built a very simple script that will hide content and reset on refresh.
What I have been asked is if there is a way the presentation can be set up ready in advance. The issue here is it could be set up an hour or a day in advance and then the browser could be closed.
I'm not looking for an advance login with saved profiles etc, however is there a way where the site will remember what content was last displayed on screen and reload it the same way either by caching or ideally by use of a username like a email address.
Here is what I have on Fiddle.
HTML
<div id="uber">
<div class="box box1">
<a href="#" class="remove">Remove</a>
<h1>Box 1</h1>
<p>Objectively simplify dynamic e-business before out-of-the-box channels. </p>
</div>
<div class="box box2">
<a href="#" class="remove">Remove</a>
<h1>Box 2</h1>
<p>Compellingly build global human capital rather than magnetic partnerships. </p>
</div>
<div class="box box3">
<a href="#" class="remove">Remove</a>
<h1>Box 3</h1>
<p>Holisticly communicate premium technologies rather than 24/7 content. </p>
</div>
<div class="pageRefresh">
<button>Refresh a Page in jQuery</button>
</div>
</div>
jQuery
$('.remove').click(function() {
$(this).closest('.box').fadeOut("slow", function() {
$(this).addClass('is-hidden');
});
});
$('.pageRefresh').click(function() {
$('.box.is-hidden').fadeIn("slow", function() {
$(this).removeClass('is-hidden');
});
});
CSS
.box {
float: left;
margin-right: 20px;
padding: 10px;
width: 20%;
background: lightgrey;
}
.pageRefresh {
clear: both;
padding: 20px 0;
}
.is-hidden {
display: none;
}