Maybe do an innerHTML call, how this would work is you would in each link have a call to a javascript function like so
<a href="#" onclick="show_recipe(1);">Beef Soup</a>
and a divider to hold the data like so
<div id="recipe_div"> </div>
the JS would look like this
Code:
recipeArray[0] = 'Your <b>HTML</b> text goes here just remember any new lines in the code must be removed.';
recipeArray[1] = '<h1>Beef Soup</h1><p>To make beef soup you will need a cow</p>';
function show_recipe(ID){
document.getElementById('recipe_div').innerHTML = recipeArray[ID];
}
Thats the basic setup you basicly create arrays of your recepi's and then the function will change the in the divider for whatever content it is loading
You say you dont like it linking to an anchor tag, well if you dont like that idea then you could do
<a href="javascript :void(0);">Link </a>
this will stop the page going to the top
if you dont want to use a link at all then you would have to use something like an onclick on a div something like
<div onclick="show_recipe(1);">TEXT</div>
That should be enough to get you going
Last edited by Paramiliar : 04-15-2008 at 01:34 AM.
|