I have an XHTML STRICT page which has some event listeners attached for onload and resize. I'm doing a bit of Javascript DHTML on these events. When a user changes the browser font size, the javascipt function needs to run. Although the TOPMENU DIV gets resized when the font changes size, its not a page resize so the function doesn't get run. I fixed this in IE6 by using a second function which is run onload and sets an event on the div object in the page after its been defined.
Problem is this doesn't work in Firefox.
Mozilla DOM reference says there is no resize event on a DIV so is there a work around to make it work in FIREFOX? i.e. can I force a resize event to happen on a div in firefox or is there some other event I can trap when a user changes the browser font size?
here's my js code: topmenu is what I'm trying to trap the resize event from.
All my font-sizes are set as relative sizes in CSS (large, medium, small, x-small, etc). Let's say something is set in CSS to be xx-large, but a visually impaired user wants it displayed even bigger. Can a script determine an element's absolute size, *as it is being rendered by the browser*, and then increment the element's font-size in absolute terms?
How can I change my text or font size when the user changes the browser size. Example: When the browser is maximized, the font goes to normal, when the browser window decreased, the font size is reduce.
Does jquery have an event defined for when the user changes the size of his browser window? I couldn't find one, but sometimes I don't see the forest for the trees.
where da boss wants our a large piece of our site to be fully dynamic and integrated on any screen size. This means changing font on size. Well I cam up with a solution, figured if no one has one better, then i'll share
I'm curious if it is possible to detect the browsers default font and size? Most of the posts on this topic predate Windows XP, IE 5.5, Mozilla Firefox, et al.
I've searched up and down the DOM properties, looped through most objects and collections alerting properties and values, and I can't find anything. This leads me to believe it is not possible to detect the browsers default font settings.
Is there a way to override the browser font size settings with javascript. Basically we want to set the text size on a page so that if someone has their browser font setting say to "large" it does not take effect.
I operate as a admin a online print site where clients can enter in contact info to create imprint on promotional items.
I create pdf templates with field placeholders |1.1|[address]
This template is uploaded to the print site which interprets the tags and makes them into variable fields for clients to enter in their info. The site can pull the font name, size, position, etc... from the pdf template.
For each info field that the site creates it also has an option to apply javascript to that field. So if the template predefines font size X, I just want to apply code that will affect only the numbers of that text and make the numbers a larger font size than the letters.
The code I'm use to writing is pretty simple stuff for example to format dots instead of dashes for phone numbers like:
if (hasValue(curInput.name)) { if (! AutoFormat(curInput, '###.###.####', 'Please enter your number in a 555.555.5555 format'))curInput.focus(); }
I need to get JavaScript to change the font size used for a website if Opera is detected. I have been trying this but it hasn't worked:
function changeFooter(){ if (navigator.userAgent.indexOf("Opera") >= 0) { // if I alert this line the output is 0 document.getElementById("footer").style.fontSize = '0.5em'; };
[Code].....
I was hoping that I could benefit from your collective wisdom as I am not sure where I am going wrong with this and several hours spent searching the web for answers have been fruitless so far...
My knowledge of JavaScript is not very extensive, I haven't studied it in great depth so perhaps I am making some very silly mistakes here.
My pseudo code for this exercise is something like this:
detect browser if browser = Opera { change font-size for body to 90% }
I've seen dozens of scripts, some in javascript, some in php, that will allow you to do one or the other. Has anyone run across a script that has three buttons/images/links that will let you increase the font size, decrease the font size and switch font families? Either JS or php will suffice.
I am using FrontPage 2003. How do I change the font, size, and color of the script? Here is the code I have:
<BODY
<SCRIPT> var date1 = "Feb 14, 2000" var mons = new Array("Jan", "Feb", "March", "April", "May", "June", "July", "August", "Sept", "Oct", "Nov", "Dec") var now = new Date(); var mm = now.getMonth(); mm = mons[mm]; var dd = now.getDate(); var yy = now.getYear(); var date2 = mm + " " + dd +", "+ yy;
function daysNoAccident() { date1 = date1.toString(); date2 = date2.toString(); date1 = Date.parse(date1); date2 = Date.parse(date2); date1 /= 1000; date1 /= 60; // minutes date2 /= 1000; date2 /= 60; var result = Math.abs(date1 - date2); result = result/60; // = hours result = result * 8/24; //hours worked per day result = result * 5/7; // working days in week result = result * 35 // number of employees result = parseInt(result); document.write ("You have worked " + result + " hours since 14th February 2000 without an accident"); } </SCRIPT>
I want to put a combo box on my webpage where the user can change the Font of the table size based on their screen resolution. The fonts will be 12,14,16 and so on.
The default font-size in tinyMCE is 10px, but I want to change it to 12px. I tried the first 20 solutions on Google, but none of them worked. I have the latest version of TinyMCE.
How would i add an avent listener to change the source of an image? I have added the image to a canvas element through javascript using the code below.
var start = new Image(); start.src = "start.jpg"; ctx.drawImage(start, 50, 50);
I build a website with Typo3 and it works fine, except for the text size in Internet Explorer (and Opera). I tried anything from changing the CSS templates (excluding them) to changing px to pt to em and so. Finally, I think i need a Javascript that detects the browser and if it is Internet Explorer (or Opera) the textsize should be reduce by 1. It therfore should be the same like manually clicking in IE on View->text size -> smaller (default is medium).
My javascript (I just use Javascript for this single purpose) does not work/it does not do anything:
function resizeText(){ if (browserName=="Microsoft Internet Explorer") {document.body.style.fontSize = parseFloat (document.body.style.fontSize) -1 ;}}
I have an iframe that includes a button: <input type="button" value="close this window" onclick="window.close();" >
I would like to detect the iframe close event from the parent window, I was using this code but I did something wrong because the temp function is fired every time the parent page loads:
function temp(){ alert('the iframe was closed'); } function setup(){ var myIFrame = document.getElementById("iframe1"); if (myIFrame.addEventListener) { myIFrame.addEventListener('onclose', temp(), false); }else if (myIFrame.attachEvent) { myIFrame.attachEvent ('onclose',temp); }else{ myIFrame.onclose=temp(); } } window.onload=setup;
How can I change font size according to window size?font-size=xx% is not working as I expect.Plz give me code for that.My wish is to chage font size according to window size, so that I can always get same type of screen.Currently when i reduce my window , my text also changes its position,looks quite messy.
when i resize the div then i want the text within font tag should be resized as per my div. for example if my div height=400 and width=200 after resized dynamically using jquery then my font (eg: vivek) must be resized with same height and width.
is there any property (in js or jqurey) through which i can set height and width of a font but not using size property.
Why is it bad to use pixels to specify font size. If people think its too small/too big, they can Ctrl + and Ctrl - in their browser even in IE. is there another reason why its a bad idea to use pxs?
I have a current script that I am using to dynamically resize the font within all paragraph tags on a page. Does anybody have a simple JavaScript that will retreive the P tag and change it's font size, either up or down a few pixels?
I would like slim code that might only work in the latest browsers. IE6 and Netscape 7 is fine.
I'm attempting to make a web page that adapts to the size of your browser size when it maximized. Because I'm only 15 I'm not such a great programmer or coder. I've done my best with the resources I have though (Fluent in Lua and a natural ability to pick languages syntax up quickly)
Here is what I have so far, it doesn't work and it is starting to puzzle me. As it seems correct as I look at it. I'm sorry if this question show my ignorance. I try my best to hide it.
Some of it is Copy pasted from sources on Google. But only for educational purposes, I learn off reading, examining and testing out snippets.
I'm basically trying to get the max size of the window and resize the div accordingly.