Log in

View Full Version : pop-up



chechu
02-25-2007, 01:33 PM
How can I create a pop-up window with scrolling, without naming it as a link to another page like this:

<a href="#" onClick="MyWindow=window.open('copyright.html','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=500,height=350'); return false;" class="id">all content and visuals copyright 2004-2007</a> |

So having it incorporated in the code of the page itself.

jscheuer1
02-25-2007, 05:26 PM
It is unclear to me what you want. You can create a pop up like so:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#copyright {
color:blue;
background-color:lightyellow;
text-decoration:underline;
cursor:pointer;
}
</style>
<script type="text/javascript">
function myPop(){
myPop.win=window.open('','copyright','scrollbars,resizable,width=500,height=150');
myPop.win.document.write('all content and visuals copyright 2004-2007');
myPop.win.document.write('<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>');
myPop.win.document.close();
myPop.win.focus;
}
</script>
</head>
<body>
<span id="copyright" onclick="myPop();">&copy;</span>
</body>
</html>

But, at that rate, you might prefer to use something like:

http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm

as, pop up blockers will prevent a pop up sometimes.

chechu
02-26-2007, 09:11 AM
That's it !
Thanks !

chechu
02-26-2007, 09:50 AM
http://www.dynamicdrive.com/dynamici...ndow/index.htm
That's what I was looking for, but just one detail:
how can I remove the function of the minimilising of the window (_) ?
I only want the visitor to be able to close the window.
Thanks !

codeexploiter
02-26-2007, 10:48 AM
I don't think it is possible to supress the minimize and maximize buttons in all the browsers.

Either have to develop some JavaScript based solution for that....

chechu
02-26-2007, 02:07 PM
In the given link, it must be possible, as you decide yourself wether to place them or not. I just don't know how to take that part out without messing the whole code up. Is this the only line I would have to take ou ?

domwindowdata+='DHTML Window <div class="drag-controls"><img src="'+this.imagefiles[0]+'" title="Minimize" /><img src="'+this.imagefiles[1]+'" title="Close" /></div>'

jscheuer1
02-26-2007, 03:45 PM
The easiest way to take something like that out without messing up the rest of the script is to set its visibility to hidden:


<img style="visibility:hidden;" src="'+this.imagefiles[0]+'" title="Minimize" />

chechu
02-26-2007, 04:02 PM
PERFECT !!
Thanks a lot !