Okay guys hopefully I can explain this effectively, so here goes.
I have a unordered list where each list item loads html pages into a div on click via jquery on my "Services" page.
Basically on the front page I have a couple links, when one is clicked, I need it to go to the "Services" and see the appropriate html page in the div.
Here's kinda how the code is:
Services Page:
<ul id="service-nav">
<li><a id="interlocking" href="#">Interlocking</a></li>
<li><a id="pool-backfill" href="#">Pool Backfill</a></li>
<li><a id="poured-concrete" href="#">Poured Concrete</a></li>
<li><a id="parging" href="#">Parging</a></li>
<li><a id="custom-land" href="#">Custom Landscaping</a></li>
<li><a id="snow-rem" href="#">Snow Removal</a></li>
<li><a id="excavation" href="#">Excavation</a></li></ul>
</ul>
<div id="right-area"> <!-- This is where we load the relevant html's -->
</div>
Front Page:
<ul>
<li><a href="services.php?token=interlocking">Interlocking</a></li>
<li><a href="services.php?token=pool-backfill">Pool Backfill</a></li>
<li><a href="services.php?token=poured-concrete">Poured Concrete</a></li>
</ul>
And here is my jQuery for your reference:
<script type="text/javascript">
$(document).ready(function() {
$(function(){
var token = window.location.toString().split("=")[1];
$("#" + token).click();
});
$('#interlocking').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/interlocking.php', function() {
});
});
$('#pool-backfill').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/pool-backfill.php', function() {
});
});
$('#poured-concrete').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/poured-concrete.php', function() {
});
});
$('#parging').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/parging.php', function() {
});
});
$('#custom-land').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/custom-landscaping.php', function() {
});
});
$('#excavation').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/excavation.php', function() {
});
});
$('#snow-rem').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/snow-removal.php', function() {
});
});
});
</script>
ok, suppose we want to show the interlocking page, so your front page should be like this:
1.
<ul>
<li><a href="services.php?token=Interlocking">Interlocking</a></li>
</ul>
2.In your service page, the jquery code should be:
<script type="text/javascript">
$(function(){
$('#interlocking').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/interlocking.php', function() {
});
});
$('#pool-backfill').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/pool-backfill.php', function() {
});
});
$('#poured-concrete').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/poured-concrete.php', function() {
});
});
$('#parging').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/parging.php', function() {
});
});
$('#custom-land').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/custom-landscaping.php', function() {
});
});
$('#excavation').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/excavation.php', function() {
});
});
$('#snow-rem').click(function() {
$('#right-area').load('http://romanstonedesigns.com/new/services/snow-removal.php', function() {
});
});
var token = window.location.toString().split("=")[1];
$("#" + token).click();
});
Bye!