473,322 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Change class for same-page links and headings

Hello!

I am totally new to JavaScript. My knowledge is barely enough to adapt some ready-made code to suit my needs.

What I'm trying to accomplish now is beyond my abilities. I have looked all over, but didn't find anything similar to what I need. Or maybe I just don't know what to be looking for.

I have a sprites based menu consisting of five links to name anchors on the same page. Each of these anchors is placed beside a header div.

I need to make the menu items keep their hover state on click and at the same time make the respective header div change its class too. When another link is clicked I need the previous one and the div to return to their original state.

So one click changes the state (class attribute) of two separate items and at the same time reverts any such previous change.

A similar example or tutorial would be great. Or just a noob-oriented explanation. Or maybe you could point me in the right direction.

Thank you!

PS
If having a look at what I have now would help - it's all here: artplusart.org/beta
Jan 31 '10 #1
2 1813
RamananKalirajan
608 512MB
Hi yousername,
You can do that. It's some what similar to Tabber Component. But instead of tab you want to highlight you header menu.

This is a example you can look into it

http://www.barelyfitz.com/projects/tabber/

You should have three classes
1) Normal
2) Highlight
3) Selected

Defaultly the first link of you header should have the class "selected" and the rest with the class "Normal" . Add onmouseover and onmouseout events for the header link. onclick of the particular link change the class to "selected" and make all the other links to "Normal". If you still cant able to get what i am saying just post back i will give you a working example.

Thanks and Regards
Ramanan Kalirajan
Feb 1 '10 #2
Thanks Ramanan! I will try what you suggest.
Feb 1 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: EsCHEr | last post by:
I created a class public class testClass { public testClass() { } public void changeForm(){ Form1.textBox1.Text = "hello"; }
7
by: Peter Oliphant | last post by:
I use to make the statement that you could always replace any 'private' or 'public' access with 'public' and the code would still compile. This is no longer the case. It turns out that in /clr...
4
by: GatorBait | last post by:
Hi, I have created a class library that I call from within my program using late binding. The class library contains a form and I allow the user to do different actions on the form that is part of...
3
by: Andy | last post by:
If I use Visual Studio.Net 2003 to generate "web references" for clients using either sproxy.exe (for C++) client or wsdl.exe (for C#) clients, the web service endpoint gets "baked" into the...
7
by: News | last post by:
I would like to know how I loop through a html file and validate it is the type of element I am seeking and then change something in the element. IE ...
3
by: manstey | last post by:
how do I detect a change in a list of class instances? from copy import deepcopy class CaListOfObj(list): """ subclass of list """ def __init__(self, *args, **kwargs): list.__init__(self,...
45
by: Zytan | last post by:
This returns the following error: "Cannot modify the return value of 'System.Collections.Generic.List<MyStruct>.this' because it is not a variable" and I have no idea why! Do lists return copies...
0
by: anileshlakhtakia | last post by:
Hi I have a class let say , Class A { public IList animal { get{}set{} } } Class B:A
3
by: Alan J. Salmoni | last post by:
Hello everyone, I searched through groups to find an appropriate answer to this one but could only find these which didn't meet my program's needs:...
5
by: Joseph Barillari | last post by:
Hi python-list, I've just started using new-style classes and am a bit confused as to why I can't seem to alter methods with special names (__call__, etc.) of new-style class instances. In other...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.