in IE, my page gets buggy when the user resizes the window. ive fixed it for when the user clicks and drags the corner of IE, but it is still buggy when the user maximizes the window. i know i can fix this as well if i can just learn to detect the difference on the onresize event between maximizing and all other ways the user can resize it.
I'm trying to make a script which will check if the string which the user sent from a form contains ONLY letters. The problem is if the user entered something like this "25 years old" it allow that to be submitted. It only blocks submissions of the form if the user submits NO letters like this "12345". I want it to block submissions if at least one character isn't a letter. Here's my code:
var message = document.myform.formtest.value; var allowed = /[A-z+]/; if(!allowed.test(message)) { alert("The field only allows letters (a-z)."); return false; }
So if the user on my website types 52 it would return the following value: 5<sup>2</sup>, or just, 5 how do I detect something like this. if they enter: 5 how can I detect the number "2" and put it superscripted past the number 5. so the javascript reads this: 5 and returns this: 5<sup>2</sup>
before starting to modify the script i juste want to know if it's gone work like this. I prefer to ask because i still know nothing about javascript even though i start to understand thing a little but here is the script for a div to be maximized! however i don't want the div to cover the whole screen in terms of height! indeed i want to leave 30px on the bottom! Code:
I was wondering if it is possible to maximise a screen in javascript.
right now, I use this code:
A HREF="heritage.html" onClick="msgWindow=window.open ('heritage.html','fullWindow','toolbar=no,location =no,directories=no,status= no,menubar=no,scrollbars=yes,resizable=yes,width=8 30,height=630'); return false" onmouseover="window.status='open site in full screen' return true" CLASS=TP>open full screen</A>
, but I was wondering if we can fill the entire screen?
I have created a frameset which is my default page. I am using window.resizeto and window.move to size and position the window on the users screen, but I also need to disable the maximize button on the window.
I know this can be done when using the window.open function as one of it's parameter's, however, as this is my landing page, I need to do this on page load.
I want the div to start out completely minimized at 0% height and then when I click the button that calls the function it should increase the size to 100%, once it is maximized I want it to set the height back to 0% when the button is clicked again. Heres what I have so far. I can get it to minimize and maximize itself but I can't get the height set correctly.
<SCRIPT language="javascript"> var y = 100; var q = 5; var f = 0;
How can I capture the maximize and minimize of a browser? It is possible to capture this events? I'm searching the web and I didn't found any results. I want to be know if the user maximize/minimize the browser ?
I'm having a problem getting the window.onresize to work properly. Here is a simple test case I wrote:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Test window.onresize</title> <script type="text/javascript"> function resize_func() { alert ('resize_func has been called'); } window. </script> </head> <body> <p>Just Some Text</p> </body>
When I load this page in firefox (1.0.6). I get the alert box that pops up on initial load, but any subsequent resizing of the window fails to trigger the event. It's probably something really simple, but so far I'm stumped.
I was trying to modify the code-slider plugin so that it would scroll panels that were the size of the entire screen. (the demo on the jquery site has it moving panels that are rather small). So I thought all I had to do was take each div that sandwiches the panel (several are nested) and set their width in code to be the width of the monitor. It did not work.
So I simplified the code to show here. I just have the divs, and their css, and the code that sets them to the width of the screen.
Here's the entire code, css, and html (its not long):
We want the panel to extend the width of the page, and eventually also figure out how to make it extend the height of the page. Then we want to put a menu on top which will scroll from panel to panel, where each panel covers the entire page. The menu would have absolute positioning, so it would stay on top.
Code... Check out this picture.. i want to make one of my lists to be shown in this way..
whenever you click the '+' sign, the products under the main products will be displayed, and when you click the '-' sign, the products under the main products will be hidden.
I have a script that is called by the window.onresize event. The problem is that the script is called multiple times when I'm resizing the window in IE - obviously, because IE continuously fires the onresize event while it is being resized.
What I'm wondering is - does anyone have any suggestions on making the script function only once, after the last onresize event, rather than on every one?
I've done some searching, but I'm not getting much - probably because I'm having trouble finding a good phrasing for the search.
I have a left column that needs to be resized based on the middle content height. (the left nav needs to be subtracted from the total maxHeight to determine how long to make the left column) I am using the following:
function adjustLayout() { var main_height = document.getElementById("main").offsetHeight; var left_nav_height = document.getElementById("vertical_left_nav").offsetHeight; var maxHeight = Math.max(main_height, left_nav_height); var left_content_height = maxHeight - left_nav_height; document.getElementById("left_content").style.height = left_content_height+'px' } window.onresize = function() { adjustLayout(); } PROBLEM: The code works in firebird (even with multiple resizing), but in IE 6 the the left nav will not shorten if resized. In fact, it appears that each time you resize, the left column gets longer, and longer - so it is stretching the page way beyond the content.
I want to make a nice floating bar at the bottom of the screen, which hovers about 15px from the bottom. I am doing this to make a site look good in small and big resolutions. The minimum height for the bar to hover is 600px about, if the window is smaller, it is still there so it doesn't go into the content, if the window is bigger, it will follow the resize and be at the bottom still. It is obviously absolutely positioned, and also centered using some javascript (getting the width of the window).The second function is called in the header and positions the bar. The last two document.get things are just for testing so I can see the height in px somewhere. This works fine in IE. If I resize the window, making it shorter, everything goes as planned, and I can see the pixel count dropping in the header where it is displayed. However, in FF it does not work.
The weird thing is this. If I resize by a small amount, less than 10px, it works fine. However, I can not resize by more than 10px! If I do, the window height shown in the top still drops by only 10px.So if my window is 1000px tall, and I close it to say 500px, the value of the height will still be 990px. If I then resize it to any where higher than the 500px, say 550px, the javascript still sees it as making it smaller, since it says the height is 990px, therefore, the window height goes down to 980px. If I shrink the window to 500px and reload everything is fine, if I make it bigger, it works in both browsers. I am thinking that this could be a problem which is like "sampling rate" in music. When in IE I expand or shrink the window I can see the pixel count drop continuously and the bar floating down as I move the window, as if it was "sampled" every 0.05 seconds or something. In FF, shrinking is not working, but if I expand the window the pixel count doesn't change and the bar doesn't change place until I stop resizing (let go of the mouse button), as if it was sampled once, when I stop, so the problem maybe is related?
I am trying to set a div width through the onresize event. For some reason, I am able to set the height ok. When setting the width, it will set once and then both the height and the width will not respond to the onresize event anymore. I basically want the div to resize whenever the browser is resized.
To demonstrate what I mean, copy and paste this code into a htm file. Add long strings of text to the div so that it will scroll both horizontally and vertically. Notice when resizing, the resize will get called once, but when resizing again it will not. Comment out the width line, and now the resizing will always get called.
I am attempting to modify the style of an element (its width) as the window is being resized, in firefox.
Long story short, I've tried to use CSS but one particular part of the layout just won't do what I need.
The javascript solution assigns a function to window.onresize that sets the inline style, it works with one problem -- the handler only gets called after the resizing stops, and so there is noticeable lag before it redraws.
It is not the function that is taking a long time to execute, its appears to be firefox's handling. It doesn't call it as frequently as I expected.
Is there another javascript method to accomplish this without the extra lag?
I've built a page which uses javascript to snap roll-over layers to a centered (div) layer. It works fine, and is called when the page loads. However, calling the same function 'onresize' works, but doesn't validate as XHTML - because the XHTML body tag does not support the onresize event handler.
As a consequence, I need to extract the onresize handler into it's own script file and use it to call a page reload.
I can get this to work in IE 6 on a PC, but it doesn't work in FireFox. I really need this to be as cross-compatible as possible. The code I have in the page header is:
Code:
<script type="text/javascript"> function reDo(){ window.location.reload() } window.onresize = reDo; </script>
Does anyone know how to achieve a cross-compatible means of reloading a page upon resizing?
I'm listening for the window.onresize event and trying to get the document.body.clientWidth afterwards to make sure a wide block fits onscreen. I'm working in Firefox and the thing is, when a scrollbar is added to the page due to content getting longer, the body.clientWidth gets smaller, but the window.onresize doesn't fire (I guess this makes sense as the window hasn't been resized per se).
I am assuming that I will have to check the body.clientWidth manually after the content gets longer and then call my resize function if so. But is there a way to achieve this or watch body.clientWidth other than window.onresize?
The window.onresize is not called (in Mozilla) when changing the text size on the browser (crtl + or View/Text Zoom).
Is the xAddEventListener function usefull ? What does the "For some browsers the window.onscroll and window.onresize events are simulated." mean ?(found in the X Library function reference).
so im almost finished my first site! very excited. its for my dads business, hes a screening contractor.actually i doubt he will get any business out of it, even once we get our real domain name and everything because i don't even know how to get Google to like it. its OK though, its mainly just a practice site for me anyways before i make a resume site for myself. anyways, this mayt sound like a flash question but i asked on flash sites and they have no idea, and i think it has more to do with how i embedded the flash. yoy see, it consists of 3 divs, an html content area, and a flash banner and a flash menu, which stretch depending on the window size to keep their aspect ratio. its that streachyness that i believe is causing the problem. everything works exactly as planned in Firefox, chrome, and pure flash player. but in IE, safari and opera, the size and position of things are way messed up! (only really care about IE). the edges of dynamic text are slightly to the left or right and hanging behind things because of it, same with some movie clips and when i didn't want things to appear on the stage i set their x position to be the length of the stage,
i think that ie is calculating the size onresize incorrectly. heres the site, take a look at the the script file:[URL]..