473,323 Members | 1,560 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,323 software developers and data experts.

Colours

Hi,

I'm after some help with some JavaScript coding.

How would I allow a user to click an icon on the homepage, so that the
website (all pages) appear with a larger text size, for example if my mum
wanted to view the site who has bad vision and needed to see a larger text
size.

Also how could it be set-up so that a user can select from a small menu of
icons, the background colour of the site, for example if the background is
normally white with black text.

However if the user wanted to change the background, the user could select a
yellow icon, and once this is clicked on the whole site background is black
with yellow text, or a green icon where the background remains black but the
text turns green.

I would appreciate any help with the above.

Best wishes,

Catherine
Jul 20 '05 #1
13 1976
"Catherine" <bi*****@hotmail.com> wrote:
I'm after some help with some JavaScript coding.
If that's what you think, why do you post _here_?
How would I allow a user to click an icon on the homepage, so that the
website (all pages) appear with a larger text size, for example if my
mum wanted to view the site who has bad vision and needed to see a
larger text size.
And this is about _colours_ exactly how?

Anyway, your mum needs to know how to change the font size on her browser.
At the simplest, how to use a browser's font size menu. Or maybe set the
font in the browser settings. Maybe she even needs a user style sheets
that defeats authors' attempts to fix font sizes. You could write
and install (as user style sheet - the methods for this depend on the
browser) something like the following for her, naturally replacing 16pt by
whatever suits her best as the basic font size:

* { font-size: 16pt !important; }
h5 { font-size: 108% !important; }
h4 { font-size: 115% !important; }
h3 { font-size: 130% !important; }
h2 { font-size: 140% !important; }
h1 { font-size: 160% !important; }
big { font-size: 117% !important; }
small, sub, sup { font-size: 83% !important; }

In any case, helping her take control over font sizes is the essential
thing and helps in using the Web in general, not on page-specific or site-
specific basis.
Also how could it be set-up so that a user can select from a small
menu of icons, the background colour of the site, for example if the
background is normally white with black text.


Browsers already have functions for setting background and text colour.
Why would you create a duplication for it?

If you wish to give users alternate styled versions of a page (with
different color schemes - remember that you need to consider link colours
whenever you change any colours), then you have many options but no good
one. <link rel="alternate stylesheet" ...> is the best in theory, but only
in theory.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #2
On Wed, 6 Aug 2003 17:58:49 +0000 (UTC), "Catherine"
<bi*****@hotmail.com> wrote:
I'm after some help with some JavaScript coding.

How would I allow a user to click an icon on the homepage, so that the
website (all pages) appear with a larger text size, for example if my mum
wanted to view the site who has bad vision and needed to see a larger text
size.
No need to use javascript: all browsers in which the text size can be
changed by Javascript (and some in which it can't) allow the users to
select a text size themselves. I suggest you have a look at the solution
on my site - see sig. And also my page on font sizes.
Also how could it be set-up so that a user can select from a small menu of
icons, the background colour of the site, for example if the background is
normally white with black text.


Try some searching on "user stylesheets".

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #3
Hi,

below some code for you, it might help!
Regards, Thomas

<html>
<head>

<style type="text/css">
p
{
font-family: Verdana;
font-size: 10pt;
}
</style>

<script language="JavaScript">

function bigger()
{
var i;
for (i=0; i<document.getElementsByTagName('p').length; i++)
document.getElementsByTagName('p')[i].style.fontSize = "16pt";
}
function normal()
{
var i;
for (i=0; i<document.getElementsByTagName('p').length; i++)
document.getElementsByTagName('p')[i].style.fontSize = "10pt";
}

</script>
</head>
<body>

<pre><a href="javascript:bigger();">Make it bigger</a></pre>
<pre><a href="javascript:normal();">Make it normal</a></pre>

<p>Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p>
<p>Paragraph 4</p>

</body>
</html>

Jul 20 '05 #4
Just cause it's 'cool' and people generally want things made as simple
as possible. It might just be a simle preference change, but you can't
dispute that more people will react to it if it is in front of their
face. I don't really ever think about changing my browser pref's, but
whenever I go to www.photos.com for example, they have links to change
their sites color scheme. It's a simple bit of fun to play with.
Anyway, when your in a market competing with other sites, anything
that makes yours stand out helps so I can see why someone might want
to implement it.

Frank Vollono
Browsers already have functions for setting background and text colour. Why would you create a duplication for it? If you wish to give users alternate styled versions of a page (with different color schemes - remember that you need to consider link colours whenever you change any colours), then you have many options but no good one. <link rel="alternate stylesheet" ...> is the best in theory, but only in theory.

Jul 20 '05 #5
sh***@pricebookservices.com (Steven Hall) writes:
Before kicking a poster in the head perhaps you should remember that the
there is a great number of people out there who don't know that there is
a difference between HTML and JavaScript (after all, to them JavaScript
*is* typed into an HTML therefore it is HTML, right?).


If that is the case, then the sooner they lose that particular
misconception the better (for them and for everyone else). How would
you suggest this is done without correcting them?

--
Chris
Jul 20 '05 #6
From prbook Fri Aug 8 09:02:32 2003
From: sh***@pricebookservices.com
Subject: Re: Colours
Newsgroups: comp.infosystems.www.authoring.stylesheets
References: <bg**********@titan.btinternet.com> <Xn*****************************@193.229.0.31> <v4wM/QF**********@pricebookservices.com> <87************@dinopsis.dur.ac.uk>
Organization:

Chris Morris <c.********@durham.ac.uk> wrote:
If that is the case, then the sooner they lose that particular
misconception the better (for them and for everyone else). How would
you suggest this is done without correcting them?


I would suggest that: "HTML and JavaScript are actually two separate
things. A question on JavaScript is best asked in a newsgroup specifically
targetd for that. This group is primarily for HTML only related
questions."

This seems far better than what Jukka did type which was: "If that's what
you think, why do you post _here_?" which was the reply to the statement
"I'm after some help with some JavaScript coding."

My version is a lot less snide and condescending

Apparantly, Jukka has *plonked* me (whatever that means---I could look
it up but I figure it's not worth it).

Steven H.
Jul 20 '05 #7
"Steven Hall" <sh***@pricebookservices.com> wrote in message
news:v4wM/QF**********@pricebookservices.com...
The all knowing about HTML (not Javascript dammit!) Jukka K. Korpela:
I'm after some help with some JavaScript coding.

If that's what you think, why do you post _here_?


Before kicking a poster in the head perhaps you should remember that the
there is a great number of people out there who don't know that there is
a difference between HTML and JavaScript (after all, to them JavaScript
*is* typed into an HTML therefore it is HTML, right?).


I originally saw this post in the Javascript group.
They couldn't answer, and referred her to this group.
She could have re-editted the question (dropping the js line)
to make it clearer.

--
Steve

Jul 20 '05 #8
Steven Hall wrote:
The all knowing about HTML (not Javascript dammit!) Jukka K. Korpela: [Catherine wrote:]
> I'm after some help with some JavaScript coding.

If that's what you think, why do you post _here_?


Before kicking a poster in the head perhaps you should remember that the
there is a great number of people out there who don't know that there is
a difference between HTML and JavaScript (after all, to them JavaScript
*is* typed into an HTML therefore it is HTML, right?).


Javascript isn't HTML. There is a seperate newsgroup, comp.lang.javascript,
just for Javascript discussion.
And this is about _colours_ exactly how?


Not content with just kicking the poster in the head, the Grand Poohbah
of HTML (not JavaScript dammit!) goes for the private parts.


And rightfully so. The subject line is deceptive.
Perhaps the poster was going to ask about colours and changed their mind
to talk about fonts but forgot to change the subject line. You correctly
deduced that they wanted an answer about font sizes, right?
Then the subject line should reflect that.
Anyway, your mum needs to know how to change the font size on her browser.


Just today, I showed two people how to change the font size for their
browser. Not as easy to intuit as you might like it to be.


Maybe they should switch to a browser that is easier to use? Maybe they
should quit being lazy?

It's really easy to find this in Konqueror. Settings / Configure Konqueror
brings up a rather large dialog box with every group of settings. Fonts is
the seventh one down on the list.

It's fairly easy to find this in Mozilla Firebird as well. Tools / Options
(a bit more intuitive than Edit / Preferences in Mozilla versions of old)
brings up a dialog box from which one can select Fonts & Colors.
I still see a great number of people *not* typing an URL into the
"address" field on their browsers. They use the search page (in Internet
Explorer) to find URLs so they can click on them. Ten years later and your
basic browser is still difficult the general population to use.


Maybe they should ditch Internet Explorer, since it's not going to be
updated for quite some time?

I don't see what's so hard about going up to the address bar and typing in a
Web address. I'm surprised that search engines don't take it upon
themselves to reduce their wasted bandwidth. Hell, I'm surprised that end
users don't realize they are compromising their own privacy by doing this!
*Especially* if they are using Google as their search engine!

--
Shawn K. Quinn
Jul 20 '05 #9
sh***@pricebookservices.com wrote:
Shawn K. Quinn <sk*****@xevious.kicks-ass.net> wrote:
Maybe they should switch to a browser that is easier to use? Maybe they
should quit being lazy?
Yeah, those lazy users. All they want to do is to use their software to
make their lives easier. All they want is software that doesn't require
wading through thick manuals to use the most basic of features.


Well, they don't. There are easy to use browsers out there. If IE is hard to
use, they need to switch to a new browser.

It does not take much for me to figure out that if the fonts on a Web site
are too small, I need to adjust my font size or zoom to be larger. (This is
one irritant I have when using Opera; unless I'm really missing something,
there is no simple "bump the font size up one notch" option, you have to
adjust the zoom, which zooms *everything*.)
Why should software be easy to use?
It should. Maybe IE is too hard to customize?
The more difficult we make our software, the less lazy shit users there'll
be out there to make life miserable for the rest of us.
You completely misread what I'm saying. If anyone expects something as
individually unique as browser preferences to be perfect for everyone out
of the box, they are sadly mistaken.
Bad attitude d00d.
Excuse me, sir, but I'm not a "d00d". If anything, I'm a "dude" and I would
think in this particular forum even that is a stretch. Don't even think
about insinuating that I am some "warez kiddie" because I'm not.
I suggest reading Alan Cooper's "The Inmates Are Running the Asylum".
I'll see if the library has it tomorrow.
Steven H.
PS. The "Inmates" aren't the users.


With a disgusting percentage of computer users using a very non-free
operating system (in both senses of the word), they may as well be. (I'll
leave the rest of the rant for a comp.os.*.advocacy group sometime,
someday.)

--
Shawn K. Quinn
Jul 20 '05 #10
Tim wrote:
On Fri, 08 Aug 2003 14:37:53 -0500,
"Shawn K. Quinn" <sk*****@xevious.kicks-ass.net> wrote:
I don't see what's so hard about going up to the address bar and typing
in a Web address. I'm surprised that search engines don't take it upon
themselves to reduce their wasted bandwidth. Hell, I'm surprised that end
users don't realize they are compromising their own privacy by doing
this! *Especially* if they are using Google as their search engine!


What's this about Google being a compromise to your privacy (any more
than anything else on the WWW is)? I've not heard of that, before.


<URL:http://www.google-watch.org/> explains it far better than I can.

Note follow-ups; not sure what newsgroup this best belongs in. (I briefly
considered comp.infosystems.www.misc.)

--
Shawn K. Quinn
Jul 20 '05 #11
I wont get involved in the text size argument but i'll take a stab at your
colour question.

Create one base style sheet which defines all the layout and any shared
colors which are used accross all pages independant of color scheme. Then
create seperate style sheets for each color which just define color changes
of the elements you wish to change. Work out the colors you will use first
and you can simply do a find and replace on the first style sheet.

You can then use javascipt or serverside scripting to change the color
stylesheet based on a user's action. By using a cookie, you could make the
user's preference permanant when they return to the site.

Matt

"Catherine" <bi*****@hotmail.com> wrote in message
news:bg**********@titan.btinternet.com...
Hi,

I'm after some help with some JavaScript coding.

How would I allow a user to click an icon on the homepage, so that the
website (all pages) appear with a larger text size, for example if my mum
wanted to view the site who has bad vision and needed to see a larger text
size.

Also how could it be set-up so that a user can select from a small menu of
icons, the background colour of the site, for example if the background is
normally white with black text.

However if the user wanted to change the background, the user could select a yellow icon, and once this is clicked on the whole site background is black with yellow text, or a green icon where the background remains black but the text turns green.

I would appreciate any help with the above.

Best wishes,

Catherine

Jul 20 '05 #12
sh***@pricebookservices.com wrote:
I would suggest that: "HTML and JavaScript are actually two separate
things. A question on JavaScript is best asked in a newsgroup specifically
targetd for that. This group is primarily for HTML only related
questions."


No, this group is for CSS related questions.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Jul 20 '05 #13
On Fri, 08 Aug 2003 20:02:02 -0500, Shawn K. Quinn <sk*****@xevious.kicks-
ass.net> wrote:
(This is one irritant I have when using Opera; unless I'm really missing
something, there is no simple "bump the font size up one notch" option,
you have to
adjust the zoom, which zooms *everything*.)


I adjusted the display size using Opera's minimum font-size option, located
at File > Preferences > Fonts (near the bottom of the page).

Sue
Jul 20 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Els | last post by:
Hi, I would like an opinion on the following: I have a page which is made up of background-images with transparent linked images in front of it, which on hover show text in CSS popups. Due to...
3
by: CSX | last post by:
Hi I have just loaded Visual Basic.Net. I find the interfact colours very drab, especially compared to Office 2003. How do I change the interface colours (currently greys & white) Ta Carlo
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
8
by: Doug Laidlaw | last post by:
I tried to grab an image from a Web page the other day. It turned out that the page was made up of three horizontal bands, and part of the image was in each. One band was a JPEG, another was a...
4
by: Tim Marshall | last post by:
The report indicated in the send object command below has various colours in it which show nicely when the report is previewed and printed. However, when sent as an attachment to users without...
0
by: Rui Oliveira | last post by:
I am using a tree from CTreeCtrl. To create the imagelist I am using a bitmap with 256 colours. But the icons in my tree only appear with 16 colours. What is supposed to do to have icons...
9
by: piyush2884 | last post by:
hi guys, got anything on this issue?
5
by: Jameson | last post by:
Hi, I have a list of known colours, generated using: Dim colorNames As New System.Collections.Generic.List(Of String) For Each known As KnownColor In .GetValues(GetType(KnownColor)) Dim...
2
by: Sodrohu | last post by:
Currently I got a thermal image mapping program which converts grayscale pictures to RGB. Now, what I need to do is to convert those 3 RGB colors into other three colours. The choice of colours are...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.