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

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="JavaScript">
function zoom(i) {
if (i==1)
{
if (document.picture1.width<700)
{
document.slika1.width=document.picture1.width*1.30
document.slika1.height=document.picture1.height*1. 30
}
}
else
{
if (document.picture1.height>100)
{
document.slika1.width=document.picture1.width*0.70
document.slika1.height=document.picture1.height*0. 70
}
}
if (i==3)
{
document.picture1.width=350
document.picture1.height=254
}
}
</script>
Jul 23 '05 #1
3 1103
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="JavaScript">
function zoom(i) {
if (i==1)
{
if (document.picture1.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.getElementById(idAttrValue)

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=document.picture1.height*1. 30
}
}
else
{
if (document.picture1.height>100)
{
document.slika1.width=document.picture1.width*0.70
document.slika1.height=document.picture1.height*0. 70
}
}
if (i==3)
{
document.picture1.width=350
document.picture1.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
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...
6
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...
4
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...
12
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...
1
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
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...
6
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...
3
by: Henrik | last post by:
Hi.. How can i resize an image from a tif-file? And save it to a new file?
4
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.