Özel Mesaj Uyarısı?

Web tabanlı uygulama geliştirme araçları(PHP, ASP vb...) ile ilgili konuları buraya yazabilirsiniz.
Cevapla
Asprogx
Üye
Mesajlar: 18
Kayıt: 10 Kas 2004 02:32
Konum: İzmir

Özel Mesaj Uyarısı?

Mesaj gönderen Asprogx »

merhaba herkese

phpBB forumda sayfayı yenilemeden özel mesaj geldiğini belirten pop-up pencere açılıyor bunu nasıl yapabiliriz?

Java Script Kodunu Bilen varmı? :?:

Teşekkürler :elsalla:
Kullanıcı avatarı
muskut
Kıdemli Üye
Mesajlar: 1118
Kayıt: 22 Ara 2003 09:50
Konum: Sandalyemden
İletişim:

Mesaj gönderen muskut »

mesela bir linke tıkladığında, sayfanın ortasında, özelliklerini (boyutları, genişletip genişletilemeyeceğini, tam ekran açılıp açılamayacağını v.b) belirleyeceğin bir örnek veriyorum.

linkin arkasındaki kod satırı:

Kod: Tümünü seç

<a href="#" onClick="GP_AdvOpenWindow('index.asp','','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no',200,200,'center','ignoreLink','',0,'borderless');return document.MM_returnValue">link</a>



JavaScript koduda burada:

<script language="JavaScript" type="text/JavaScript">
<!--
function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,center,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v1.1
  var autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (center && center != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {
      w = screen.availWidth; h = screen.availHeight;}
    var leftPos = (w-popWidth)/2, topPos = (h-popHeight)/2;
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  popupWindow = window.open(theURL,winName,features);
  if (popupWindow.opener == null) popupWindow.opener = self;    
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow.resizeTo(popWidth,popHeight); popupWindow.moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
    	ontopIntervalHandle = popupWindow.setInterval("window.opener.popupWindow.focus();", 50);
    	popupWindow.document.body.onload = function() {popupWindow.setInterval("window.opener.popupWindow.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
    	popupWindow.document.body.onbeforeunload = function() {
  			if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
    		window.onbeforeunload = null;	}  
   		autoCloseTimeoutHandle = window.setTimeout("popupWindow.close()", autoCloseTime * 1000); }
  	window.onbeforeunload = function() {popupWindow.close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}
//-->
</script>
Not : HUSONET Tarafından Code Taglarına alınmıştır.
Asprogx
Üye
Mesajlar: 18
Kayıt: 10 Kas 2004 02:32
Konum: İzmir

Mesaj gönderen Asprogx »

Teşekkürler
Cevapla