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
JavaScript Show one hide others
Old 11-26-2008, 09:10 AM JavaScript Show one hide others
Average Talker

Posts: 16
Trades: 0
Hi, why this is not working ??


Code:
<script language="javascript" type="text/javascript">
function showHide(obj) { 
    var s== document.getElementById(obj);
      if (s=='ac') { 
       document.getElementById('ac').style.display='';
         document.getElementById('klav').style.display='none';
		 document.getElementById('bat').style.display='none';
      }
      else
         if (s=='klav') { 
		 	document.getElementById('ac').style.display='none';
			document.getElementById('klav').style.display='';
			document.getElementById('bat').style.display='none';
         } else 
		 if (s=='bat') {
		 	document.getElementById('ac').style.display='none';
			document.getElementById('klav').style.display='none';
			document.getElementById('bat').style.display='';
		 }
		 
 }

Last edited by chrishirst; 11-26-2008 at 09:29 AM..
oszone is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-26-2008, 09:30 AM Re: JavaScript Show one hide others
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
what is it doing (or not)

"not working" is a pretty vague description
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-26-2008, 09:43 AM Re: JavaScript Show one hide others
Average Talker

Posts: 16
Trades: 0
when I press one link it shows one div and hides two other divs :] and the same for all tree links, show one div and hide others..
oszone is offline
Reply With Quote
View Public Profile
 
Old 11-26-2008, 10:04 AM Re: JavaScript Show one hide others
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
yep, I can see what it's supposed do. I have the same thing working at creeme.inyoursite.co.uk though it operates a little differently, it's ostensibly the same thing.

What is it actually doing for you to say "it's not working"
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-26-2008, 10:11 AM Re: JavaScript Show one hide others
Average Talker

Posts: 16
Trades: 0
So could you share it ?
oszone is offline
Reply With Quote
View Public Profile
 
Old 11-26-2008, 10:30 AM Re: JavaScript Show one hide others
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
sure, it's in

creeme.inyoursite.co.uk/common_files/include/js-funcs/inc_js-funcs_dl-menus.js

and the CSS rules (dl.closed & dl.open) are in creeme.inyoursite.co.uk/_templates/style/style-nav.css
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-26-2008, 10:43 AM Re: JavaScript Show one hide others
Average Talker

Posts: 16
Trades: 0
hmm, sorry it do not work for my somehow... maybe it is possible to fix my function ?
oszone is offline
Reply With Quote
View Public Profile
 
Old 11-26-2008, 10:51 AM Re: JavaScript Show one hide others
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
maybe it is possible to fix my function
Seems like a plan!

Are you going to tell us what is wrong with it, rather than expecting us to recreate your page?
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-26-2008, 11:19 AM Re: JavaScript Show one hide others
Average Talker

Posts: 16
Trades: 0
no, now I use http://www.laptopshop.lt/src.js but it does not hide divs... thats the problem.. just ads and hides ONE div, I need to show one and hide others :]]
oszone is offline
Reply With Quote
View Public Profile
 
Old 11-26-2008, 12:51 PM Re: JavaScript Show one hide others
Average Talker

Posts: 16
Trades: 0
I ment that mayby I need other function to write, instead of fixing this..
oszone is offline
Reply With Quote
View Public Profile
 
Old 11-26-2008, 08:47 PM Re: JavaScript Show one hide others
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Is this something like you wanted Tabs?

Code in the page and write up is at DHTML Tabs
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-27-2008, 02:39 AM Re: JavaScript Show one hide others
Average Talker

Posts: 16
Trades: 0
Something like that.. there is the mine example: http://www.laptopshop.lt/dalys.php
oszone is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to JavaScript Show one hide others
 

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