PDA

نسخه کامل مشاهده نسخه کامل : جاوا اسکريپت : وقتی رو لينک کليک ميشه يه پنجره داخل همون صفحه باز بشه



nazanin_271_2005
18-12-2005, 19:10
man ye code java script mikham ke vaghty roo ye link click kardam ye panjere dakhele hammon safhe baz beshe

mostafa_zare
19-12-2005, 23:32
این رو بذار تو تگ هد:
<script language="javascript" type="text/javascript">
<!--
//popwin
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.rand om()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Mat h.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.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=no,menubar=no,too lbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>

این هم جایی که می خوای لینک باشه:
<a style="text-decoration: none" a onclick="NewWindow(this.href,'mywin','305','404','no','cent er');return false" onfocus="this.blur()"
href="thanks.htm">با تشکر از</a>