How to load two pages with .load in to two different div ??
Hallo.
I'm begginig with jQuery. I'm trying to make a simple menu with jQuery.
this is my .js code.
- $(document).ready(function(){
$('#menutop li').click(function() {
$('.current').removeClass();
$(this).addClass('current');
var menu_down = $('.current').text();
var link_koncowka = $('.current').text() + '.php';
$("#srodek").load( "inc/" + link_koncowka, {}, function(){ //calling the ajax then with a callback afterwards
});
switch (menu_down)
{
case 'Sklep':
$("#napis2").load( "inc/menu.php", {}, function(){ //calling the ajax then with a callback afterwards
});
case 'Opcje':
$("#napis2").load( "inc/menu2.php", {}, function(){ //calling the ajax then with a callback afterwards
});
default:
}
});
});
html :
- <div id="menu_top">
<div id="napis">
<ul id="menutop">
<li class="">
<a href="#">Sklep</a>
</li>
<li class="">
<a href="#">Opcje</a>
</li>
</ul>
</div>
</div>
<div id="menu_down">
<div id="napis2">
</div>
</div>
How can I load page menu.php or menu2.php with correctly loaded firs page.
I hope You understand my problem.