Reputation: 91
I have this menu in HTML / CSS:
HTML:
<div id="outer">
<div id="inner"><a href="kingkong.html">King Kong</a></div>
<div id="inner"><a href="table.html">Table</a></div>
CSS:
#inner {
background-color: #547980;
width: 130px;
margin-left: 8px;
}
#inner:first-child {
background-color: #547980;
width: 130px;
margin-left: 8px;
margin-top: 8px;
}
div {
border-radius: 5px;
border: 2px solid black;
}
and I want load page in jQuery.
margin-left
position 140
and printing to margin-right
position 20
or But I don't know how to do it. Any advice please?
Upvotes: 0
Views: 76
Reputation: 1662
With jQuery you can use this script:
$('body').on('click', 'a', function(event) {
event.preventDefault();
var href = $(this).attr('href');
$('.result').load(href);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a href="kingkong.html">Menu Link</a>
<div class="result"></div>
Upvotes: 0