我的网站仅包含一个页面,其中所有其他页面都加载在 div 中,我想做的是创建面包屑以跟踪 div 内加载的页面,我在互联网上找到的所有解决方案仅适用于加载的页面整个窗口,所以有人有更好的主意吗?我的页面:
<div id="nav" class="mmenu" style="float: left; position: fixed;">
<ul type="none">
<li><a class="upper" id="1" style="border-top-left-radius: 6px; border-top-right-radius: 6px; background-image:url('menu icons/user-blue.gif'); background-repeat: no-repeat; background-position: left; background-position-x: 5px;" target="collabsoft" href= "ProfilePage.php?property_variable=mine">My Profile</a></li>
<li><a id="2" style="background-image:url('menu icons/comments.png'); background-repeat: no-repeat; background-position: left; background-position-x: 5px;" target="collabsoft" href= "viewMessages.php">Messages</a></li>
<li><a id="3" style="background-image:url('menu icons/newspaper.gif'); background-repeat: no-repeat; background-position: left; background-position-x: 5px;" target="collabsoft" href= "userHomepage.php">My Conferences</a></li>
<li><a id="4" style="background-image:url('menu icons/pageflip.gif'); background-repeat: no-repeat; background-position: left;background-position-x: 2px;" target="collabsoft" href= "availableConferences2.php">Conferences</a></li>
<li><a id="5" style="background-image:url('menu icons/users.gif'); background-repeat: no-repeat; background-position: left; background-position-x: 5px;" target="collabsoft" href= "incomingRequests.php">Requests</a></li>
<li><a id="6" style="background-image:url('menu icons/book.gif'); background-repeat: no-repeat; background-position: left;background-position-x: 5px;" target="collabsoft" href= "viewNews.php" >News</a></li>
<li><a class="lower" id="7" style="border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; background-image:url('menu icons/gear.gif'); background-repeat: no-repeat; background-position: left;background-position-x: 5px;" target="collabsoft" href= "generalOptions.php" >Options</a></li>
</ul>
</div>
<table id="collabsoft_table" style="border: 0px;">
<tr>
<td id="collabsoft_td"style="border:0px;">
<div scrolling="no" id="collabsoft" name="collabsoft" style="color: #003366; left:200px; display:none;position: absolute; border: 5px #1f487c solid; width: fit-content; height: fit-content; border-radius: 10px;"></div>
</td>
</tr>
</table>
用于在 div 中加载页面的函数:
$("#nav a").click(function(event) {
event.preventDefault();
var page = $(this).attr("href");
$("#collabsoft").slideUp("500",function() {
$("#collabsoft").load(page,function() {
$(this).slideDown(500);
});
});
return false;
});