JavaScript - New Windows And Dual Monitors
Ok I need to open a popup in a second monitor. The browser will be open in the first monitor and the popup needs to open in the second monitor (we'll say it's to the left for now). I have tried a few Javascript methods. I don't have PHP avaliable to me in this case but I do have the ability to use JSP and will shortly have JQuery.
Here is what I have tried so far: Code: <script type="text/javascript"> function popup(url, winName, xOffset, yOffset) { var x = (window.screenX || window.screenLeft || 0) + (xOffset || 0); var y = (window.screenY || window.screenTop || 0) + (yOffset || 0); return window.open(url, winName, 'top=' +y+ ',left=' +x); } </script> <form> <input type="button" onClick="popup('http://www.google.com', 'myWin', -600, 100)" value="Show Customer"/> </form> and Code: <script type="text/javascript"> function popup() { window.open( "http://igatedev.kirbyrisk.com/DualMonitorTest/product.jsp?part=545347", "myWindow", "status=0, fullscreen=0, resizable=1" ) } </script> Any help is much appreciated. Also I was wondering if there was a way to have the popup close with the original window, or with a button click from the first. Similar TutorialsHi, would someone know how to convert the left side (textbox) into the same thing as the right has (select box) also by modifying the JS code from the example of this URL: http://www.mredkj.com/tutorials/tableaddrow.html ? It would be a really good feature to have if two select options were used from side-to-side rather than a textbox and a select list. Hi, I'm after a drop down script that basically you press categories and down it drops with say one side products by category the left side and say product by price the right side. Ign.com do it when you click on one of the top links I'm just not sure of the name and the most easiest to implement? Any help wolf be great Many thanks Joe Hi Guys, I have a Javascript function that toggles a 'show/hide' table row: //CONTROL Code: <a href="#" onclick="toggle('ROW 1, this)"><img src="../../Images/plus.gif" border="0" /></a> //JAVASCRIPT Code: function toggle(id, obj) { var matchingElements = new Array(); if (document.getElementsByClassName) { matchingElements = document.getElementsByClassName(id); } else { var elements = document.getElementsByTagName("tr"); for (i = 0; i < elements.length; i++) { if (elements[i].className == id) { matchingElements[matchingElements.length] = elements[i]; } } } for (i = 0; i < matchingElements.length; i++) { toggleDisplay(matchingElements[i], obj); } } function toggleDisplay(element, obj) { if (element.style.display == "none") { element.style.display = "block"; obj.innerHTML = "<img src=\"../../Images/minus.gif\" border=\"0\">"; } else { element.style.display = "none"; obj.innerHTML = "<img src=\"../../Images/plus.gif\" border=\"0\">"; } } Which works fine, but what I need is something like this: Control 1: Toggle - ROW 1 (+ Close ROW 2 (if visible)) Control 2: Toggle - ROW 2 Is this a Javascript or PHP issue? Hello all, my second post! I finally got the below script working in Firefox and was really pumped about it until I realized it didn't load in Google chrome or Safari. What this script does is its a dual onclick event which makes a hidden div appear and loads an iframe within the now visible div. Here is the code, I would love any input on how to make this work in other browsers. Here is the header code: Code: <SCRIPT type="text/javascript"> <!-- var state = 'none'; function showhide(layer_ref) { if (state == 'block') { state = 'none'; } else { state = 'block'; } if (document.all) { //IS IE 4 or 5 (or 6 beta) eval( "document.all." + layer_ref + ".style.display = state"); } if (document.layers) { //IS NETSCAPE 4 or below document.layers[layer_ref].display = state; } if (document.getElementById &&!document.all) { hza = document.getElementById(layer_ref); hza.style.display = state; } } //--> </script> <SCRIPT type="text/javascript"> function loadIframe(iframeName, url) { if ( window.frames[iframeName] ) { window.frames[iframeName].location = url; return false; } else return true; } </script> Here is the code on the page where a link click shows the hidden div and loads the iframe contained. Code: <p><a href="#" onclick="showhide('div1');return loadIframe('ifrm1', 'http://www.google.com');">show/hide me</a></p> </td></tr> <div id="div1" style="display: none; position: fixed; z-index:4; width: 1010px; height: 500px; left: 5%; top: 15%; background-color: #f0f0f0; border: 1px solid #000; padding: 10px;"><iframe name="ifrm1" id="ifrm1" width="100%" height="90%" scrolling="yes" frameborder="0">Sorry, your browser doesnt support iframes.</iframe><p><a href="#" onclick="showhide('div1')">close</a></div>'; As always, any input is greatly appreciated! -Removed due to solution found-
You can see the website here with all the code to make it easier for you to diagnose what is happening: Code: http://www.fdfdaa.com/desktop/desktop.html When you go to the start menu and select anything on the left side, you will see that windows open 100% of the screen by default. I did that by adding maximized:true but that doesn't appear to be working for the icons on the desktop itself. If you click on one of those 4 icons on the desktop though, it isn't opening at 100% for some reason. You can see my classes file here as well: Code: http://www.fdfdaa.com/desktop/classes.js Any help will be greatly appreciated. Thank you for your time! Hello! I'm trying to make a website that from one link, opens multiple windows. It is for a design project (I'm still at uni). So far I have mustered just the one window. Here is the website: http://popmeup.org/ The idea is that you get bombarded with lots of nice quotes. I don't know my arse from my Javascript - but has anyone got any advice? Hi. I don't know if anyone here has downloaded the dev edition of windows 8 yet (it was released last night 5:00p, est) I am trying to get jquery to work, but it just wont... I tried simple stuff, but I was hoping someone here knew how. Thanks I thought I did everything right but pop-up windows aren't working... Code: <td> <a href="javascript:popUp('http://www.retrocitysunglasses.com/popupfreeshipping.html')"><img src="http://www.retrocitysunglasses.com/website_graphics/header_free_shipping.jpg" alt="Free Shipping"></a> </td> Code can be found on this page (very first section after body opens): http://retrocitysunglasses.com/ This is my first time writing any JavaScript, so I am not very familiar with the language. I want to make a window be kept at the back, under all other windows. From what I understand, the method to do this would be window.blur(), but I cannot seem to get it to work. Have I misunderstood the functionality, or am I implementing it wrong? The part of the code I have that currently deals with this (or at least tries) is as follows: Code: <BODY onclick="window.blur()" > <img src="imageurl" id="image"></img> </BODY> I've tried a few other events to trigger this (onmouseover, setInterval, etc.) but no way I've tried has worked. So, is blur() the right method to do this? have I done something wrong in the implementation? Any help and guidance is appreciated. Backstory (if it should matter for some reason) : I found a webpage ( here and here ) that generates an image of the Earth as seen from space at a given time and I wanted to place that image, updated on a regular basis, as my desktop image. I looked around for a way to do it, but as far as I could find, there was no way to do it easily in Windows XP. Thus, I am now using Samurize (a program for overlaying graphics etc. at your desktop) to create a browser window that loads a html file that periodically updates the image. While this window cannot be moved and has no borders, it can be selected and if it is selected, the image is brought to the front, overlapping any other windows. I wish to make it such that this cannot happen; I have tried configuring Samurize as well as asking for help on their forums, but no luck so far. This is a pet peeve of mine and I'm still looking for a solution. If I have designated a specific size dimension for a popup window to open with (as one must, otherwise why even use a pop-up window?) then it should be obvious that the window needs to open up at 100% (normal) magnification, otherwise the contents of the window will not be displayed properly. It seems to me current browsers are struggling with this problem, as Firefox, Safari, and Opera all handle it differently. For example, Firefox applies magnification settings defined by the user to dimensions of the pop-up window but not to the contents (an odd solution!); Opera retains the correct dimensions but applies magnification to the contents. Only Safari handles it correctly: even if you have applied magnification to a web page it will still open pop-up windows at default 100% magnification and honor the dimensions specified in the HTML code by the page designer. Thanks for any help you can provide. This seems like it would be so simple and I have absolutely no idea. I have one page with no frames, and two links on it. The second page has an iframe on it. Both links on page 1 point to page 2 (which houses the iframe), but based on which link is clicked will determine what that iframe will display. Basically I need to figure out a way to target the iframe on page 2 after executing a window.open statement. Much like how google images creates a frame at the top after you click on one of the images from the search results. I've attached two simple files to better explain what I'm trying to do. FrameSet.zip I'd appreciate the help, I'm losing my mind. In the past I write the jave script to popup windows in the browser for tell our visitor about news & event but now most of browser will block popup by default. Someone can show me an example about the professional popup with out the block.Thank you
I have searched high and low to find this script. Not having much luck at all. What i want to do is, when someone clicks a link the image pops up on screen in its own nice window smack down in the middle of the screen over top of the website. I want it to look neat tho, best example i can find is @ curse.com http://wow.curse.com/downloads/wow-a...st-helper.aspx If you click that link and scroll down to the screen shot section and click on one of the images you can see how nice and professional it looks. How can i accomplish this? Thanks so much in advance~ Hi, I'm trying to make a pop up window that should work such as the window the pops up when you press "View all friends" on one of your friends' profiles on Facebook. Is this possible? Thank you! Hi Guys, I want to develop a javascript code which will open a pop up window and a JSP page in it. That JSP page will load a 'Select' list which user will select a value from and I want that value to be returned to my parent form (window). I remember implementing the same long time back (almost 5years now) ...can anyway help remind me how did I do it...or how can I do it? Regards, -- SJunejo Hi, I need javascript to sort as windows sorts its file. For eg: When the files name contains special characters, number and alphabets(#@!$%.doc, test1.doc,test2.doc, 1.doc) javascript sorts alphabets first and then special characters, but windows sorts special characters first and then alphabets in ascending. I want javascript to sort my array as windows. Kindly help me out in this case. Thanks, Deva. Hi everyone, I'm trying to capture the order in which the windows I've opened using window.open are layered on top of each other. For example, if I open three windows, starting with the first on the bottom and the third on top, but I then focus on the second window, bringing it to the top, is there a way to capture the new window order (2 on top, then 3, then 1)? I know that window.top can give me the first one, but from there, without closing it, is there a way to tell what the next one underneath it is? Thanks in advance, Katherine I have a js script to unlock a user account on my windows xp system below. Can anybody help me for a js code which can be used to connect to another windows system in the network with a username and password and run this script on that system and ends the session? the script can be placed to that system. I just need a script which logins to that system and run this script on a periodic basis and ends the session after that. The current script "autolock.js", unlocks the user account which has been locked by invalid password tries. Code: UnlockAccount( "Computer", "devtest1" ); // Unlock account using ADSI. // // Domain: Is the domain where the account resides, computer // or domain accounts. For account local to a machine use // the computer's netbios name. For domain accounts, use // the domain name. // // Account: Is the account name to be unlocked. // function UnlockAccount( domain, account ) { try { var user = GetObject( "WinNT://" + domain + "/" + account ); if( user.IsAccountLocked ) { user.IsAccountLocked = false; user.SetInfo(); //print( "Account Unlocked" ); } else { //print( "Account was not locked" ); } } catch( e ) { print( "Error: " + e.description ); } } function print( msg ) { WScript.Echo( msg ); } Hi - I have an ASP.Net 4.0 solution that runs fine on a Windows 2008 server. However, I've just been given a new Windows 7 64-bit machine to use as my development machine and I'm having a problem with one of my aspx pages. This page has some javascript on it, which runs fine, but then it gets to the following code: Code: <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['aspnetForm']; if (!theForm) { theForm = document.aspnetForm; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> </script> This not code that I've written; it's code that's generated client-side that I see as I'm debugging my app in Visual Studio 2010 (trying to figure out what the $^#$ is going on). At any rate, once this code completes, the app does nothing. The debugger should take me to some server-side code, but it doesn't. It just sits there. The result is that the page doesn't do what it's supposed to do (no inserts to databases, no success messages, no nothing). As I said, this problem is restricted to my W7 64-bit machine; it runs fine on W2008. Other pages with javascript in the same solution work fine on my W7 machine. I found a post (http://dopostback.net/index.php/net-...anel-problems/) that discusses a similar issue within an UpdatePanel, but I'm not using UpdatePanel. My page does have hidden controls on it, but so do other pages that work just fine. Does anyone know what could be causing this? Thanks! |