WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Site Design > Graphics & Design Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

View Poll Results: Do you think the new Flash will be better than the last version
yes 20 37.04%
no 34 62.96%
Voters: 54. You may not vote on this poll

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-02-2003, 09:27 AM
jazzmatazz2005 jazzmatazz2005 is offline
WebProWorld Member
 

Join Date: Aug 2003
Location: Jersey City, NJ
Posts: 71
jazzmatazz2005 RepRank 0
Default I cant create a popup window

This should be nonthing to all you vets but I need to know how to create a regular popup window to use in my web site www.rockdamic.com. Please help me out with this or tell me where i can go to find out how to do it.

thanks
Reply With Quote
  #2 (permalink)  
Old 09-02-2003, 10:40 AM
Paulo's Avatar
Paulo Paulo is offline
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Farnborough, UK
Posts: 382
Paulo RepRank 0
Default

OK, this one works for me...

Put this code in your head tags...
Code:
<script language="JavaScript" src="pop-up.js"></script>
Save this code as pop-up.js...
Code:
function popupWindow(win,winWidth,winHeight,place,winName){
	leftPos = 0; topPos = 0;
		if (screen){
    		if (winWidth>screen.width){
    		   winWidth = screen.width;
    		}
    		if (winHeight>screen.height){
    		   winHeight = screen.height - 55;
    		}
    		if (winWidth <= 0){
    		   winWidth = screen.width;
    		}
    		if (winHeight <= 0){
    		   winHeight = screen.height - 55;
    		}
			if (place == 'centre'){ // centres window
			leftPos = screen.width/2 - winWidth/2;
			topPos = screen.height/2 - winHeight/2;
			}
		}
		newWindow = window.open(win,winName,'toolbar=no,location=no,scrollbars=yes,
resizable=no,width='+winWidth+',height='+winHeight+',left='+leftPos+',top='+topPos+'');
	//	newWindow = window.open(win,winName,'alwaysRaised=yes,titlebar=no,toolbar=no,
location=no,scrollbars=auto,resizable=no, width='+winWidth+',height='+winHeight+',
left='+leftPos+',top='+topPos+'');
		newWindow.focus();
	}
	
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Sorry, right click is not available on this page");
return false;
}
return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
And then use this link, replacing TARGET-URL for the filename of the target, WIDTH and HEIGHT for the pixel value size of the window.

There's a no-right-click function in there you can rid of if you need to

Hope that helps...
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum
Tags: create, popup, window



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Search Engine Friendly URLs by vBSEO 3.0.0