}//if(document.getElementById("parent_for_video").style.display !=
"none")
}//window.onresize = function ()
You should be able to see that when a resize is detected i move and
resize a couple of divs.
The thing is though i cant work out how to do this in real time. That
is the calculations only happen when i let go out the mouse. So if i
resize from massive to small the changes dont get reflected untill i
stop dragging the mouse.
I'd like to be able to resize and stuff as the mouse is dragging the
dimensions.
Im using the cycle plugin trying to make a banner slide tha is 100% the width of the window, my problem is that when i resize de window the banner does not align center, it stays somo what left align. So is there a way to keep the slides align center after you resize the window usingthe cycle plugin? or is there another plugin that i can do that? I attached a image to ilustrate, the white banner with the cat should align center when i resize the windows but it stays left align.
I'm trying to develop a function to resize a control upon window resize. In regular javascript I would make a global array of control names and append code to the event that cycles through and resizes each control.For example
var proportionalizedImages=new Array(); proportionalizedImages.push(document.getElementById(ctrl)); if (window.addEventListener)[code]....
I'm wondering if there's a more elegant way to do this in jQuery. I've played around with it a bit, but i'm unsure how to get the control object to the resize function triggered by window resize without a global variable.
I'm trying to scale the text with the size of the window (I've also got all the layout sizes in ems, so this should keep the aspect ratio of everything the same as the window is resized). The code that I've got at the moment doesn't do anything -
I am trying to pop up a window and then do stuff(set flags) when the content of the new window is done loading. For this I am trying to detect the window.onload of the pop-up child window but so far I am unsuccessful. I believe my problem is that the URL of child window is on different domain, than the one of the opener(parent) so that the window.onload is not being called. Thought this may change, at the moment I do not have access to the code for the page I'm opening up in the pop-up. Im pretty new to web development.
Heres my js code
Code:
//globals var popupHandle = null; var openingWindow = false; function popWindow(URL){
[Code]....
Note: The whole reason why I am doing this is because if its the first time I am clicking on the button that will open this pop up window and I click it repeatedly very quickly, a new pop up is opened for each time I clicked eventhough the window.open is supposed to reuse the window if it has the same windowId. The first call to window.open takes long enough to not have a window handle and allow other clicks to get through.
If I perform a mousedown within a document, move the mouse outside the browser window, and then release the mouse button, the document.onmouseup event does not fire. Is there any way to detect a mouseup event outside the document?
Also, how can I get the relative coordinates of the cursor while it is outside the browser?
Can anybody let me know how to detect when my user clicks the X button on the window. I used unload event it did not work(on IE). My web page is a .asp page which reloads itself when navigating on the site. Now whenever the user clicks any links on the page the unload event is triggered which is not what I want. I only want to detect when user clicks the X button and not when the URL changes.
code i used: <body onunload="alert('leaving window');">
Basically this alert window is triggered everytime the URL changes and not just when the window closes(which is what i want).
I recently downloaded a tabs plugin demonstrated on thisI tweaked the CSS so it matched my website, and brought in some dynamic content (via. PHP & MySQL). The PHP draws the 4 most recently updated blogs, and the tabbing system is picking which query is shown (news, rant, all)...btw, the 'news' and 'rant' currently just have 2 a piece for testing purposes.If you load it up with Google Chrome or Firefox you'll see it works fine, but if you load it up in IE, you'll see that INITIALLY it looks fine, but then each entries text chunks (title and posted X ago) get dropped underneath and the icon when a tab is clicked...the dashed line (spacer) also shortens momentarily.
when a user clicks on a link, a new window opens. what I want to do is that if the user closes that popup but click on that same link again, the window should open..
Code: <script language="javascript"> var winOpen = "";
I am a newbie to using jquery and have been exploring it developing a new app. At the moment I have a number of AJAX calls to the server which I have been queueing in an array and using a single $.ajax call to handle all of them. However I know about the browser limitations of two calls per page (at the same time and want to implement this to speed up page updating). To test concurrent ajax requests I have setup various asp pages to with delays 1sec, 5sec, 10sec etc etc. and a test html file with the follwing javascript
I am doing some work, where I want to have a table heading that remains in a fixed position, when the window is scrolled (I will ultimately have a very long table). I have written the code below, which fixes the heading.
I am trying to make it so that each body row of the table gets hidden, when the window is scrolled such that the row passes above the heading row.
To do this I need to somehow detect the distance of each row from the top of the window as the window is scrolled so I can detect when it goes above the fixed heading row. I have tried to do this using offsetTop and scrollTop in the code below, but it doesn't seem to be working (in Safari at least, which I am using for my main testing).
Does anyone know a simple way of detecting the distance to the top of the window so I can use it in my code below, which will work in all browsers?
(I don't really want to use div, and overflow-y:auto to achieve the fixed heading scrollable table, because I don't want to have a sub-section with its own scrollbar. I just want to have the main page scrollbar when the list gets long enough to require it.)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head>
I have done some ugly hacking in JavaScript before but nothing serious. Now I have decided to learn the language properly, so yesterday I threw together a function plotter that you can see here: balazsbotond dot hu/plotterThe script is here: balazsbotond dot hu/plotter/raphael-test.jsI use Google Chrome as my primary browser. My script works perfectly in every other browser (IE6, IE8, FF, Opera, Safari), but there are some problems in Chrome. Some functions do not work at all (exp()), some do not always work (sin(x) works, x*sin(x) works sometimes, 0.7*x*sin(x) never works). Since I am new to JS and this seems to be a very subtle problem, I have no idea where to start.
I have read that the use of eval() is not recommended because of performance and security reasons. erformance is not a problem here (eval is definitely better here than writing my own expression parser), but what about security? Did my use of eval introduce a security risk in my site (I find this quite unlikely because the whole thing runs on the client side but who knows...)?By the way, is there a way to detect if eval() was not successful?And finally, is there a reliable, cross-browser way of getting the client size of the window? I'm talking about the size without the title bar, toolbars, etc. My solution does not work in IE6 and IE8.
I would like to either resize a FRAMESET to a specific height width...
or I would like to know how to resize a single window if someone types in the url directly. I found the onLoad "resize()" function but I can't remove the TOOLBARS... i tried the "self" and "document" functions without luck...
I have a div that I want to resize as the browser window resizes. I do not (cannot) use a percentage size for the div. How can I get my javascript to trigger an even when the window is resized?
Is there any way to have a browser window resize itself when displaying a new HTML page? I'm using the javascript below to open a NEW window at a certain size, but I'd prefer the page to load in the same window, just sized differently. Here's the script I'm currently using:
When I use the following code snippet in all major browsers (Chrome, FF, Safari, Opera, IE8), the window opens with a scroll bar and it is resizeable EXCEPT IN IE8. In IE8, there's no vertical scroll bar and it's not resizeable... any idea why not?window.open('http://www.mysite.shtml?' + report_vars, '', "status=no, toolbar=no, location=yes, menubar=no, scrollbars=yes, alwaysRaised=yes, resizable=yes, width=" + window.outerWidth / 1.1 + ", height=" + window.outerHeight-0.1);
This is something that i came up with a while back, but never got around to putting up. when you resize a window, you don't get the same result across different browsers because of different chrome sizes. the way around this, is to resize your window based on the visible document area. this function does that.
this should work in IE4+ and NS4+. i've tested it in IE5+, and Moz 1+
<SCRIPT><!-- self.resizeIn = function(new_w, new_h) { var old_w = self.innerWidth || document.body.offsetWidth; var old_h = self.innerHeight || document.body.offsetHeight; if (!new_w) { new_w = old_w; } if (!new_h) { new_h = old_h; } new_w -= old_w; new_h -= old_h;
A dynamically created html page contains a body tag with a single (filled) table in it. Sie size of the table changes in a wide scale (from 5% to 150% of the screen size independent in height and width. The page is displayed in a popup window opened either via an onclick-event or a href anchor (depends on the navigation). Now the obvious problem is this: When choosing a fixed window size things look silly most of the time. Either you have a nearly empty window or you have to scroll all the time...
So I want to resize the window. Resize it to what size? The size that is required by the pages content when redered in the browser. That's all :-)
-- hmmm -- I tried around quite a lot with scrollHeigths, offsetWidth and so on, but there does not seem to be any more or less reliable solution., Especially not when trying to make stuff usable for different browsers. Does anyone have a hint what else I can try, where I could look?
I would like to automatically resize a window to its content. I was thinking of using an outer table to detect the size of my content, then use window.resizeTo( ).
The problem is I'm not sure how I can determine the size of what I think is referred to as the 'chrome' - the window borders, toolbars, etc.
Is there a way to determine the height and width of the chrome so that I can supply the correct parameters to the resizeTo method?