Reply
Content appear/disappear
Old 04-12-2008, 09:44 PM Content display script
odha's Avatar
Skilled Talker

Posts: 67
On my page, www.outdoorhighadventure.com/recipes.htm, I am going to have just a table at the top with the recipe names and when the user clicks on one, the recipe appears below the table, and when a user clicks on another, the first recipe disappears and the new one appears. Can someone provide me with the script to do this? I'm not to savy with javascript.... Also, before a user clicks on any recipe, I want a brief message to appear in the space that the recipes appear. Thanks!

Last edited by odha : 04-13-2008 at 11:27 AM.
odha is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 04-14-2008, 11:01 AM Re: Content appear/disappear
chrishirst's Avatar
Super Moderator

Posts: 11,866
Location: Blackpool. UK
something like http://www.candsdesign.co.uk/article...y-footer/demo/ for example.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-14-2008, 12:59 PM Re: Content appear/disappear
tripy's Avatar
Fetchez la vache!

Posts: 1,850
Name: Thierry
Location: In the void
Maybe something more like this: http://www.dynamicdrive.com/dynamici...daccordion.htm
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 04-14-2008, 05:05 PM Re: Content appear/disappear
odha's Avatar
Skilled Talker

Posts: 67
No, I don't want them is pretty little colored boxes. I just want the text to simpley display below. Maybe something along the lines of http://javascript.internet.com/misce...t-display.html. I don't like that script, but if that is the only option I have I can play with it. I don't like the fact that it is in a table and I want to have something like an ad display before the user clicks on a link. You can check out http://www.outdoorhighadventure.com/test.htm where I have installed the scirpt a bit (sorry for all the mess, that is obviously my test page...) click on Breakfast Cereal, and Logan Bread. I don't like that I have to have it link to something or the cursor doesn't change to a hand, so when the user clicks on an option, I have to have it go to an anchor tag, which I don't like. If you know what I mean....
odha is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 01:31 AM Re: Content appear/disappear
Experienced Talker

Latest Blog Post:
Long time no … erm post?
Posts: 45
Name: Matthew Bagley
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">&nbsp;</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 &nbsp; 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
__________________
Matthew Bagley
Paramiliar Design Studios
Who am I | Free Layouts |Website Development | UK SEO

Last edited by Paramiliar : 04-15-2008 at 01:34 AM.
Paramiliar is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 07:25 PM Re: Content appear/disappear
odha's Avatar
Skilled Talker

Posts: 67
I'll be honest, I dont' know javascript. You are going to have to tell my how to implement that code into my html file. Thanks.
odha is offline
Reply With Quote
View Public Profile
 
Old 04-16-2008, 02:11 PM Re: Content appear/disappear
Junior Talker

Posts: 4
You may want to look at jquery or scriptaculous. They are javascript libraries with show hide effects with plenty of demo examples.
somnamblst is offline
Reply With Quote
View Public Profile
 
Old 04-16-2008, 09:00 PM Re: Content appear/disappear
odha's Avatar
Skilled Talker

Posts: 67
Paramiliar's example sounds good if I could get a little more help on that. Again, sorry experts, but I'm new at this whole thing!
odha is offline
Reply With Quote
View Public Profile
 
Old 04-20-2008, 07:39 PM Re: Content appear/disappear
odha's Avatar
Skilled Talker

Posts: 67
Well I just did it the easy way. Check it out at http://www.outdoorhighadventure.com/recipes.htm. If you have any idea why my two lists at the top don't line up together, give me some help at a different post, http://www.webmaster-talk.com/html-f...-together.html. Thanks you guys!
odha is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Content appear/disappear
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.16549 seconds with 13 queries