Visual C
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Tutorialized ForumsDesktop ProgrammingVisual C

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old February 20th, 2007, 01:47 PM
The Creator The Creator is offline
Contributing User
Tutorialized Beginner (1000 - 1499 posts)
 
Join Date: Jan 2006
Location: England
Posts: 1,287 The Creator New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 22 m 35 sec
Reputation Power: 0
Send a message via MSN to The Creator
class toggling problem

ok, basically i want to have something that goes bold when u click it and then when u click it again it changes back to normal.

i want to do this using css for the classes and javascript to change the classes 'onclick'...

this is the function i made:

function toggleStyleGrey(obj){
var tl = document.getElementById(obj);
if(tl.className="menutitlegrey"){
tl.className='menutitlegreyopen';
} else {
tl.setClassName='menutitlegrey';
}
}

it nearly works; when i click it, it goes bold...

but then when i click it again it doesnt change back...

this is the code for the actaual thing i wanna change:

<div class="menutitlegrey" id="yourcats" onclick="toggleStyleGrey('yourcats');">

i think it might be something to do with the fact that i got

<div class="menutitlegrey"

and the script is only reading that...

does anyone else know a way round it or can see what the problem is?

thanks


Joe

Reply With Quote
  #2  
Old March 4th, 2007, 12:23 PM
Chippo Chippo is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Stockport, UK
Posts: 462 Chippo New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 23 h 28 m 4 sec
Reputation Power: 0
Send a message via MSN to Chippo
could you not just do

tl.style.font-weight = 'bold';

tl.style.font-weight = 'normal';

Reply With Quote
  #3  
Old March 4th, 2007, 01:32 PM
The Creator The Creator is offline
Contributing User
Tutorialized Beginner (1000 - 1499 posts)
 
Join Date: Jan 2006
Location: England
Posts: 1,287 The Creator New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 22 m 35 sec
Reputation Power: 0
Send a message via MSN to The Creator
oh, i forgot to end this post, in the end i fixed it by changing the if statement from == to != and swap it around, i dunno why this worked, i just did lol

Reply With Quote
Reply

Viewing: Tutorialized ForumsDesktop ProgrammingVisual C > class toggling problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT