473,700 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

resizeing text with javascript ???? THANKS

uso
Hi, how can I resize text on my web page. From smaller
fonts to larger. For example, on web page I click several
times on picture or butten or... and my text several times
go larger, when I click on other picture it goes smaller.
I have donn it with picture, but in this version I onley
change the width and heigt parametars. Sorry for bad
English. THANKS

<script language="JavaS cript">
function zoom(i) {
if (i==1)
{
if (document.pictu re1.width<700)
{
document.slika1 .width=document .picture1.width *1.30
document.slika1 .height=documen t.picture1.heig ht*1.30
}
}
else
{
if (document.pictu re1.height>100)
{
document.slika1 .width=document .picture1.width *0.70
document.slika1 .height=documen t.picture1.heig ht*0.70
}
}
if (i==3)
{
document.pictur e1.width=350
document.pictur e1.height=254
}
}
</script>
Jul 23 '05 #1
3 1118
uso wrote:
Hi, how can I resize text on my web page. From smaller
fonts to larger.


Alter the CSS font-size property of the body element (assuming you haven't
done something silly like defining font sizes for other elements in a size
that isn't proportional to the user's preference).

I wouldn't bother though. I'm not aware of any browser which would support
that that doesn't come with its own facility for resizing text. Presenting
users with UIs that duplicate existing functionality but which only work
for your site is generally a bad idea.
--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #2
DU
uso wrote:
Hi, how can I resize text on my web page.
By first choosing relative font-size unit values (like em or %). And
then by letting the user do this himself via his browser interface.
Duplicating the interface of the browser is usually a bad idea.

From smaller fonts to larger. For example, on web page I click several
times on picture or butten or... and my text several times
go larger, when I click on other picture it goes smaller.
I have donn it with picture, but in this version I onley
change the width and heigt parametars. Sorry for bad
English. THANKS

<script language="JavaS cript">
function zoom(i) {
if (i==1)
{
if (document.pictu re1.width<700)
This will only work in MSIE. Give the pictures (the <img> element) an id
attribute value and then access these elements this way

document.getEle mentById(idAttr Value)

Using Web Standards in Your Web Pages
http://www.mozilla.org/docs/web-deve...tml#dom_unsupp

{
document.slika1 .width=document .picture1.width *1.30
document.slika1 .height=documen t.picture1.heig ht*1.30
}
}
else
{
if (document.pictu re1.height>100)
{
document.slika1 .width=document .picture1.width *0.70
document.slika1 .height=documen t.picture1.heig ht*0.70
}
}
if (i==3)
{
document.pictur e1.width=350
document.pictur e1.height=254
}
}
</script>


DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Firefox 1.0.4 :)
Jul 23 '05 #3
DU
DU wrote:
uso wrote:
Hi, how can I resize text on my web page.

By first choosing relative font-size unit values (like em or %).

W3C Quality Assurance tip for webmaster:
Care With Font Size, Recommended Practices: Forget <font>, use CSS
"Do not specify the font-size in pt, or other absolute length units.
They render inconsistently across platforms and can't be resized by the
User Agent (e.g browser).
Use relative length units such as percent or (better) em, (...)"
http://www.w3.org/QA/Tips/font-size#goodpractice

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Firefox 1.0.4 :)
Jul 23 '05 #4

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

Similar topics

3
6163
by: Randell D. | last post by:
Folks, I'm still learning javascript - I've invested in a couple of books and reading online as much as possible. I'm pretty sure what I am suggesting is possible though I'm trying to weigh up the faults that might go with the suggestion... all opinions welcome. My question: I have a list of links that go to pages that have a similar layout. Could I have a text swap, similar to what I've seen with image swaps (or an image switch)...
6
6100
by: nate | last post by:
Hello, Does anyone know where I can find an ASP server side script written in JavaScript to parse text fields from a form method='POST' using enctype='multipart/form-data'? I'd also like it to parse the filename. <form name='form1' method='POST' enctype='multipart/form-data' action='sub.asp'> <input type='text' name='title1' value='value1'> <input type='file' name='file1'>
4
3428
by: frogman042 | last post by:
My daughter is playing around trying to learn JavaScript and she wrote a small program that prints out a message in increasing and decreasing font size and color changes. She is using document write and it works fine until she puts it into a function and then calls the function from a button with onClick. This also seems to work OK, with the exception that the page is cleared, and the curser changes (and stays) as an hourglass. In...
12
2295
by: Randell D. | last post by:
Folks, I have a form called "ourTestForm". Its a test form - nothing special - it contains five input tags - they are named one, two, three, four and five. The input tags are of type text,text,radio,checkbox and select. When I run the following code, it correctly reports "text" (for input
1
3757
by: IkBenHet | last post by:
Hello, I found this script to create a simple rich text form (http://programmabilities.com/xml/index.php?id=17): <html> <head> <title>Rich Text Editor</title> </head> <body>
3
1982
by: moondaddy | last post by:
I have some text in a page that when a certain even happens, I need to make it glow from black to red (through a spand of 1 second) pause for a few seconds, and then slowly change from red to black over a span of 1 second again. Lastly, this needs to be compatible with NS 4 if possible, or if not possible, then at least so NS4 doesnt crash or get errors. This is to flag a user that something has happened. Thanks.
6
13012
by: Chris Fink | last post by:
Does anyone know it is possible to include a small image(.gif .jpeg) within a <SELECT><option> so that the user would see the option text as well as a little image(icon) in the option? I know this is not an ASP.NET related question, but I know this group is knowledgeable and quick with responses. Thanks
3
977
by: Henrik | last post by:
Hi.. How can i resize an image from a tif-file? And save it to a new file?
4
8667
by: Dabbler | last post by:
Is there a way to mark the text in a TextBox control as selected so when the user types a new value the existing text is replaced? Thanks
0
8729
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9217
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9078
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7815
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6563
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5903
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4407
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4660
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.