3
I have an HTML code and I need to make a transition (fade) when I enter another page through the HTML menu I have. The problem is that I’m not able to make this transition. I need to do something like this site http://www.big.dk/#news that if you notice the left menu, when you click on another link it transitions into the right side divs. The code I have is
index php.
<div class="navbar-inverse white" role="navigation">
<div id="logo">
<img src="images/logo.png" width="100" height="40">
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar navbar-collapse collapse margins" style="overflow-x:hidden;overflow-y:hidden;">
<ul class="nav nav-sidebar">
<li class="active"><a href="#">Overview</a></li>
<li><a href="index.html">Reports</a></li>
<li><a href="#">Analytics</a></li>
<li><a href="#">Export</a></li>
</ul>
</div>
<div class="col-sm-9 col-md-10 main" id="conteudo">
<h1 class="page-header">Dashboard</h1>
<h2 class="sub-header">Section title</h2>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Header</th>
<th>Header</th>
<th>Header</th>
<th>Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>1,001</td>
<td>Lorem</td>
<td>ipsum</td>
<td>dolor</td>
<td>sit</td>
</tr>
<tr>
<td>1,002</td>
<td>amet</td>
<td>consectetur</td>
<td>adipiscing</td>
<td>elit</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready( function () {
$("a").click(function (){
$("#conteudo").fadeOut("slow").load(this.href).fadeIn('slow');
return false;
}
);
});
</script>
Your code is working on me, just a question. When I run the page (index.php) it shows all the content you have on the page even the Divs lorem2, lorem3, lorem4. How do I stop when starting scripts only show lorem1 the rest to stay hidden?
– Alisson Acioli
see that I added it in css to hide all pages from 2 to 5... otherwise it would hide with jquery.
– Jader A. Wagner
is that the site is not opening here so I don’t see the css. I would like to post?
– Alisson Acioli