OK, there is one change to the Multi-Part Content script and one change to its markup. Change the script here by adding the red part in place of the 0 that is currently there:
Code:
function onloadfunct(){
getElementbyClass("multiparts")
partscollect[curpart].style.display="block"
document.getElementById("formnavigation").style.display="block"
updatenav()
}
Change the markup (HTML portion) by removing the style shown here in red:
Code:
<div class="multiparts" style="display: block">
<p>Content 1 here</p>
</div>
<div class="multiparts">
<div>Content 2 here</div>
</div>
<div class="multiparts">
<table><td>Content 3</td></table>
</div>
Finally, add this script to the head after the Multi-Part Content script:
Code:
<script type="text/javascript">
/*Load content from Query script
*As first seen in http://www.dynamicdrive.com/forums
*This notice must remain for legal use */
function get(key_str) {
var query = window.location.search.substr(1);
var pairs = query.split("&");
for(var i = 0; i < pairs.length; i++) {
var pair = pairs[i].split("=");
if(unescape(pair[0]) == key_str)
return unescape(pair[1]);
}
return null;
}
if (location.search&&get('dcount')!=null)
curpart=get('dcount')*1;
</script>
Now, let's say the page with Multi-Part Content script on it is multi.htm - All you need to do to get a particular content to display when linking to it is to have the href include a query string (red) like so:
Code:
<a href="multi.htm?dcount=1">Link Text or Image Tag</a>
where the 1 refers to which content you wish to be displayed. The content parts are numbered from 0 to one less than however many you have. Zero is the default. If no query string is used, or if you use ?dcount=0 the first content part will be displayed. Use 1 for the second, 2 for the third and so on.
Bookmarks