Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Dynamically Changing Styles

Reply
Thread Tools

Dynamically Changing Styles

 
 
Dennis M. Marks
Guest
Posts: n/a
 
      12-05-2003
Please tell me where to look or answer the following. Can a div or span
style be changed from within the html outside of the div or span? Can
it be done without javascript? What I would like to do is alter the
color of menu items depending on the availability of javascript.

For Example:

<STYLE>
#xxx {color: black}
</STYLE>
------
<SPAN ID="xxx"">
<a href="xxxxx">MENU ITEM</a>
</SPAN>
------
<NOSCRIPT>
--change style in ID="xxx" to color: red
</NOSCRIPT>

--
Dennis M. Marks


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
Reply With Quote
 
 
 
 
Eric Bohlman
Guest
Posts: n/a
 
      12-05-2003
"Dennis M. Marks" <(E-Mail Removed)> wrote in
news:051220030711091432%(E-Mail Removed):

> Please tell me where to look or answer the following. Can a div or span
> style be changed from within the html outside of the div or span? Can


No.

> it be done without javascript? What I would like to do is alter the
> color of menu items depending on the availability of javascript.


You can still accomplish that task easily: just set the colors to what you
want them to be if JS is unavailable, and then use an onLoad event to run a
script that changes them.

 
Reply With Quote
 
 
 
 
Dennis M. Marks
Guest
Posts: n/a
 
      12-05-2003
In article <Xns944864038E717ebohlmanomsdevcom@130.133.1.4>, Eric
Bohlman <(E-Mail Removed)> wrote:

> "Dennis M. Marks" <(E-Mail Removed)> wrote in
> news:051220030711091432%(E-Mail Removed):
>
> > Please tell me where to look or answer the following. Can a div or span
> > style be changed from within the html outside of the div or span? Can

>
> No.
>
> > it be done without javascript? What I would like to do is alter the
> > color of menu items depending on the availability of javascript.

>
> You can still accomplish that task easily: just set the colors to what you
> want them to be if JS is unavailable, and then use an onLoad event to run a
> script that changes them.
>


I managed to do it as follows. By default I have the color of specific
lines red. Then a script changes them to black. If there is no
javascript the color remains red and I display a warning message.
See http://www.dcs-chico.com/~denmarks/index.html

Did I use the combination of class and id correctly? The ids are unique
but the class is not.

--
Dennis M. Marks


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
Reply With Quote
 
 
 
Reply

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Hyperlink Styles for Each Row in a Table Brett ASP .Net Web Controls 1 01-25-2008 03:43 PM
Dynamically changing styles in DataGrid tshad ASP .Net 2 08-23-2007 04:32 PM
changing styles of gridview et ASP .Net Datagrid Control 0 01-26-2007 06:11 PM
Menu bar and changing styles with fixed position? Eric Pinnell HTML 5 02-25-2004 06:17 PM
Changing styles sheets on a per user basis =?Utf-8?B?VGVycnk=?= ASP .Net 2 02-04-2004 03:41 AM



Advertisments