News

Log In Sponsors
Partner Sites





Cannot get .focus to work in firefox



I cannot an existing child window to focus in firfox using the below. This script works fine under Safari and Netscape. Is there a way to make a child window focus in firefox? [code:2nquxgdp]var win=null; var openedYet=false; function poppy(mypage,myname,w,h,scroll,pos){ //alert ("area 0"); if(!openedYet){ //alert ("area 1"); if(pos=="random"){ LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100; settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; win=window.open(mypage,myname,settings); } if(pos=="center"){ LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100; settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; win=window.open(mypage,myname,settings); } else if((pos!="center" && pos!="random") || pos==null){ LeftPosition=50; TopPosition=50; alert ("area 2: Did not specify correct position or gave no position"); } openedYet=true; }else{ if(loaded=="false"){ LeftPosition=x; TopPosition=y; //alert("im loaded but needs new win"); settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; win=window.open(mypage,myname,settings); }else{ // this focus will not work - why? win.focus(); } } }[/code:2nquxgdp]

Click here to read the whole forum topic






cron