I have tried implementing Google code into my own code yet I have been unsuccessful. Im unsure how? You could say I
m very mush still a novice.
I start by explaining the code:
After clicking a link on the navigation, a click event fires on the main page, that show/display hidden links in the iframe. These links link too other pages.
The problem as follows:
Now the problem comes in if the user clicks on the back button to get back too the overview, the user`s selection is gone/hiden once more.
$("#navig li a").click (function() {
if($("#iframeID").contents().find("title").is(":contains('item')")) {
// Jump to overview.
window.frames[frame].location = "overview.html";
} else {
// Hide all elements after every new selection.
$("#iframeID").contents().find("#contentID a").addClass("hidden");
}
var attrValue = $(this).attr("rel");
var longStr = attrValue.split(",");
for (i=0; i < longStr.length; i++) {
$("#iframeID").contents().find("#contentID a:[rel='"+longStr[i]+"']").removeClass("hidden");
};
// Start of the cookie code. ref=http://code.google.com/p/cookies/wiki/Documentation
var foo = $("#iframeID").contents().find("#content a").not(".hidden").attr("rel");
$.cookie("cookieName", foo, { expires: 7 });
return false;
});
Thank you all.