颜色 [英] Colours

查看:48
本文介绍了颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在寻求一些JavaScript编码方面的帮助。


我如何允许用户点击主页上的图标,以便

网站(所有页面)显示较大的文字大小,例如,如果我的妈妈

尺寸。


另外如何设置以便用户可以从
图标,网站的背景颜色,例如,如果背景是

通常为白色,带有黑色文字。


但是如果用户想要更改背景,用户可以选择一个

黄色图标,一旦点击整个网站背景就是黑色

黄色文字或绿色背景保持黑色的图标,但

文字变为绿色。


我将非常感谢上述任何帮助。


祝福,

凯瑟琳

解决方案

" Catherine" <双***** @ hotmail.com>写道:

我正在寻求一些JavaScript编码方面的帮助。


如果这就是您的想法,为什么要发布_here_?

我如何允许用户点击主页上的图标,所以
网站(所有页面)显示较大的文字大小,例如,如果我的妈妈想要查看视力不好的网站,并且需要查看更大的文字大小。


这是关于_colours_究竟是怎样的?


无论如何,你的妈妈需要知道如何更改浏览器的字体大小。

最简单的方法是如何使用浏览器的字体大小菜单。或者可以在浏览器设置中设置

字体。也许她甚至需要用户样式表

,这会让作者试图修改字体大小。您可以编写

并安装(作为用户样式表 - 这取决于

浏览器的方法)类似于以下内容,自然替换16pt by

最适合她的基本字体大小:


* {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; }


在任何情况下,帮助她控制字体大小是必不可少的b $ b事物并且有助于一般地使用Web,而不是特定于页面或者网站 -

具体基础。

另外如何设置以便用户可以从一个小的图标菜单中选择背景颜色例如,如果
背景通常为白色,带有黑色文本。




浏览器已经具有设置背景和文本颜色的功能。

为什么要为它创建复制品?


如果您希望为用户提供页面的替代样式版本(

不同的颜色方案 - 记住你需要考虑链接颜色

每当你改变任何颜色时),那么你有很多选择,但没有好的

一个。 < link rel =" alternate stylesheet" ...>理论上是最好的,但理论上只有



-

Yucca, http://www.cs.tut.fi/~jkorpela/


2003年8月6日星期三17:58:49 +0000(UTC),Catherine

< bi ***** @ hotmail.com> ;写道:

我正在寻求一些JavaScript编码的帮助。

我如何允许用户点击主页上的图标,以便
网站(所有页面)显示较大的文字大小,例如,如果我的妈妈想要查看视力不好的网站,并且需要查看较大的文字大小。


无需使用javascript :所有浏览器,其中文本大小可以通过Javascript更改
(以及其中一些它不能允许用户自己选择文本大小。我建议你看一下我网站上的解决方案

- 见sig。还有我的字体大小页面。

另外如何设置,以便用户可以从一个小的菜单中选择
图标,例如网站的背景颜色,例如如果背景通常为白色,带黑色文字。




尝试搜索用户样式表。


-

Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/





低于你的一些代码,它可能会有所帮助!

问候,托马斯


< html>

< head> ;


< style type =" text / css">

p

{

font-family:Verdana;

字体大小:10pt;

}

< / style>

< script language =" JavaScript">


函数更大()

{

var一世;

for(i = 0; I< document.getElementsByTagName( P)的长度。; 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 :更大();">将其设为更大< / a>< / pre>

< pre> ;< a href =" javascript :normal();">使其正常< / a>< / pre>


< ; p>第1段< / p>

< p>第2段< / p>

< p>第3段< / p>

< p>第4段< / p>


< / body>

< / html>

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

解决方案

"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/


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/


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>


这篇关于颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆