Posts: 2
Name: Joan
Location: Cebu city Philippines
|
i have tried that a pop up box appears when a link is click but its in javascript. Anyway here is the code
var managewin=null;
function DGNewWindow(mypage,myname,w,h,scroll,pos) { if(pos=="random"){LeftPosition=(screen.width)?Math .floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Mat h.random()*((screen.height-h)-75)):100;} if(pos=="center"){LeftPosition=(screen.width)?(scr een.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;} else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20} settings='width='+w+',height='+h+',top='+TopPositi on+',left='+LeftPosition+',scrollbars='+scroll+',l ocation=no,directories=no,status=yes,menubar=no,to olbar=no,resizable=yes'; if(managewin!=null) { managewin.close(); } managewin=window.open(mypage,myname,settings); managewin.focus(); }
To call this function from html use this:
<a href="#" onclick="DGNewWindow('mypage','myname','width,'hei ght','yes/no','pos')">
|