Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Content appear/disappear
Old 04-12-2008, 10:44 PM Content display script
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
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!
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE

Last edited by wildbackpacker; 04-13-2008 at 12:27 PM..
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
 
Register now for full access!
Old 04-14-2008, 12:01 PM Re: Content appear/disappear
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
something like http://www.candsdesign.co.uk/article...y-footer/demo/ for example.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-14-2008, 01:59 PM Re: Content appear/disappear
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Maybe something more like this: http://www.dynamicdrive.com/dynamici...daccordion.htm
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 04-14-2008, 06:05 PM Re: Content appear/disappear
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
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....
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
Old 04-15-2008, 02:31 AM Re: Content appear/disappear
Experienced Talker

Latest Blog Post:
Long time no … erm post?
Posts: 45
Name: Matthew Bagley
Trades: 0
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

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by Paramiliar; 04-15-2008 at 02:34 AM..
Paramiliar is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 08:25 PM Re: Content appear/disappear
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
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.
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
Old 04-16-2008, 03:11 PM Re: Content appear/disappear
Junior Talker

Posts: 4
Trades: 0
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, 10:00 PM Re: Content appear/disappear
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
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!
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
Old 04-20-2008, 08:39 PM Re: Content appear/disappear
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
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!
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
Reply     « Reply to Content appear/disappear
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.87324 seconds with 12 queries