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. [URL]. 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?
I am implementing a pop up window and need it to be centered. Found this code (below) seems to work good. I need to open it with an image rather than text link.
<script type="text/javascript"> <!-- function popup(url){ var width = 300; var height = 200; var left = (screen.width - width)/2; var top = (screen.height - height)/2; var params = 'width='+width+', height='+height; params + = ', top='+top+', left='+left; params + = ', directories=no'; params + = ', location=no'; params + = ', menubar=no'; params + = ', resizable=no'; params + = ', scrollbars=no'; params + = ', status=no'; params + = ', toolbar=no'; newwin=window.open(url,'windowname5', params); if (window.focus) {newwin.focus()} return false; } // --> </script> <a href="javascript: void(0)"onclick="popup('popup.html')">Centered popup window</a>
im looking for a javascript code that will open a window in 100% width, no toolbars, no menubars, no statusbar, nothing but the page conent basically but for it to all be centered on the screen vertically
There are 3 graphics (top left of page) which open a linked page in a pop up window; each popup comes into focus the first time it's opened - clicking on the same graphics again doesn't bring the already opened popups back into focus.I had originally sized each popup as 320x430px in the body at each of the 3 references to the linked pages, but discovered that (in FF portable 3.65.13) the popups all opened full-size windows. In an attempt to resolve this I removed the size info from each of these 3 page references (lines 84, 89, 94) and moved it to the head (line 67) which seems to have resolved the size issue, but works only when I specify the popup to be any size except the original size of 320x430 (e.g. 320x431; I have now settled for 321x431)
I know how to use javascript to modify a newly opened window's properties. Instead, what I want to happen is someone clicks on a link and they stay in the current browser window, but the window size changes to fit my specifications.
i've searched this forum before posting but didn't find a "clean" solution to my problem. I have an image with a link on it:
Code:
<a href="#null" onClick="addValue('bold');"><img src="images/myimage.gif" title="Some text" alt="Some text" /></a> which adds the value in a textarea in the same page via this function:
Code:
function addValue( val ) {
var tb = document.forms['valuesform'].elements['valuesfield'];
if ( tb.value.length > 0 ) tb.value += " , ";
tb.value += val; }
I need to disable the link after the image has been clicked,preventing multiple insertions of the same value. I've modified the link this way:
Code:
<a href="#null" onClick="addValue('bold'); this.onclick=null;" ><img ...... but while only one click is allowed,i get many JS errors in the JSConsole like
Code:
uncaught exception etc.... and i think this is not a good sign.=
I have a little tabbed content window that uses jquery and I have an annoying little problem: whenever I click on one of the tabs, the page resets to the top, so if you click on the last tab, you have to scroll down to see it again.
Here's a link: [URL]
If you look at this page in IE, I know, it displays all screwed up. I'm too tired to tackle IE today.
I am pretty new to javascript, safe to say I have never written anything, just edited. I am trying to write this function now to replace image inside a div on clicking a link. Here's what I have so far -
Quote:
function ReplaceContentInContainer(id, source) { var domlu = new Image(); domlu.src = "source";
[code]....
It shows up the image source instead of the image itself when I run it.
I have a div popup on my test site and i'm having trouble centering it. For some reason (which probably has everything to do with the code) the pop up shows in the middle of the page, as opposed to the middle of the screen. Forcing people to scroll down to see it. You can check it out here: Test page. Is there any way I can code it to where it always shows in a visible position?
Here's my javascript code: function toggle(div_id) { var el = document.getElementById(div_id); if ( el.style.display == 'none' ) { el.style.display = 'block';} else {el.style.display = 'none';} } function blanket_size(popUpDivVar) { if (typeof window.innerWidth != 'undefined') { viewportheight = window.innerHeight; } else { viewportheight = document.documentElement.clientHeight; .....
And here's the html: Code: <div id="blanket" style="display:none;"></div> <div id="popUpDiv" style="display:none;"> <a href="#" onclick="popup('popUpDiv')">Click Me To Close</a> test </div> <a href="#" onclick="popup('popUpDiv')">Click Here To Open The Pop Up</a>
I am using Fancybox plugin and works well but for an ajax call the first few calls the popup/modal appears at the bottom of the window but later corrects itself and then is centered.
Here is an example:
Example Link
Click on the 'Foliage', 'Base' or 'Trunk' boxes in the right side column.
I am trying to use javascript to add a popup window so a user can add a link to there website (in iframe/design mode) after they have selected the text that they want to turn into a link. I am currently using the popup code:
Code:
function createURL() { var szURL=prompt("Enter a URL:", "http://"); if ((szURL != null) && (szURL != "")) { Editor.execCommand("CreateLink",false,szURL); } }
IE7 and IE8 show a message saying something about allowing it and i think this will scare the users. I am looking for a method that will popup a window and allow them to fill in the link details and if possible allow them to pick a (link) target.
basicly like [URL] does. I have read something about the inserthtml function thats with javascript but im not sure if this is what is being used with tinymce. I am sure this is possible as they have done it using javascript.
Here is the link that I am using to open the popup window. It works great except when the $id variable contains a single quote. I have the single quote escaped with a . What am I doing wrong?
I'm having issues with links on my intranet pages that navigate outside of my intranet to other intranets hosted in the same server farm. When I click the links they just do nothing. Links within my intranet site work fine. Is there any kind person here that is capable of pointing me in the direction of resources to force a popup using javascript and making it navigate to the desired link?
I am using JavaScript for popups in my OpenLayers map. All the html tags like <br> work in the popup window except for the link href tag. Everytime I put in a link in my popup window it doesnt work:
var mystring = "here is link:<br> <a href="www.sun.com">link</a>";
popup = New OpenLayers.Popup.FramedCloud("chck", feature.coord, null, mystring, null, true, onPopupClose);
Also tried link without quotes and with ticks and nothing seems to work with the link not taking me anywhere.
I am trying to get a pop up window to open when clicking an image map link. The pop up works but needs to be the size of the image (no white space) Image size is actually 365 x 500. I can not post the url because I am new. It pops up but is a small (not image size) pop up and has white space.
I've added a popup window to my discussion board's index page. The popup window contains an image. When i click on the image link to the popup, all I get is my discussion board's index page. I can't figure out where to place the image code so that the image appears....
I am trying to launching a centered browser window via a form-button using the following code...
<button type='button' onClick="window.open('myURL','testwin','width=400, height=400, left=(screen.availWidth-400)/2, top=(screen.availHeight-400)/2'); return false"> Test button</button>
The new browser appears the correct height and width, but the left and top clauses are ignored.Am I being too ambitious trying to make this code in-line? Is there any other syntax I should use or should I give-up and call a function instead (I would rather not if I can avoid it)?I am using Firefox 3.0.17 (latest), but the same effect happens in IE7.
I am trying to launching a centered browser window via a form-button using the following code... <button type='button' onClick="window.open('[URL]','testwin','width=400, height=400, left=(screen.availWidth-400)/2, top=(screen.availHeight-400)/2'); return false"> Test button</button>
The new browser appears the correct height and width, but the left and top clauses are ignored. Am I being too ambitious trying to make this code in-line? Is there any other syntax I should use or should I give-up and call a function instead (I would rather not if I can avoid it)? I am using Firefox 3.0.17 (latest), but the same effect happens in IE7.
There's an outgoing link on my website that is sometimes slow to respond. I want to show a spinning wheel image after clicking it. Here is how I do it:
There are 2 problems: Firefox doesn't remove the "loading" class when going to another page and clicking the browser's Back button. Google Chromedoesn't add the class "loading". Instead itimmediately opens the pagetargetedby the link.I solved this by adding a "delay()". Is this the best approach?
I need to make a image open a popup window, I know how to do it like this:
function load2() { var load = window.open('pictures','','scrollbars=no,menubar=no,height=800,width=840,resizable=yes,toolbar=no,lo cation=no,status=no'); }
then on the link just have it go to javascript:load2()
But I have a ton of different links and don't want a bunch of code in the beginning of my pages. Is there a way to make the first part just the dimensions of the new window but then when I actually make the link, I could put where I want it to link to? Like javascript:load2(pictures).