Apostilas de Java e java para WEB
http://blog.caelum.com.br/apostilas/
terça-feira, 9 de setembro de 2008
POPUPS
Classic javascript popups windows
Player simples ( simple player )
var UniqueID = 314 // Make each link open in a new window
var newWinOffset = 0 // Position of first pop-up
function PlayerOpen(soundfiledesc,soundfilepath) {
PlayWin = window.open('',UniqueID,'width=320,height=120,top=' + newWinOffset +',left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
PlayWin.focus();
var winContent = "<html><head><title>" + soundfiledesc + "</title></head><body bgcolor="'#000'">";
winContent += "<b style="'color:#fff;font-size:18px;font-family:Verdana,sans-serif;line-height:1.5'">" + soundfiledesc + "</b>";
winContent += "<object width="'300'" height="'42'">";
winContent += "<param name="'SRC'" value="'">";
winContent += "<param name="'AUTOPLAY'" value="'true'">";
winContent += "<param name="'CONTROLLER'" value="'true'">";
winContent += "<param name="'BGCOLOR'" value="'#FF9900'">";
winContent += "<embed src="'" autostart="'TRUE'" loop="'FALSE'" width="'300'" height="'42'" controller="'TRUE'" bgcolor="'#000'"></embed>";
winContent += "</object>";
winContent += "<p style="'color:#ccc;font-size:12px;font-family:Verdana,sans-serif;text-align:center'"><a href="'">Faça download</a> <span style="'font-size:10px'">(right-click or Option-click)</span></p>";
winContent += "</body></html>";
PlayWin.document.write(winContent);
PlayWin.document.close(); // "Finalizes" new window
UniqueID = UniqueID + 1 // newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower
}
Exemplo :
<a href="endereço da url da música" target="_blank" onClick="javascript:PlayerOpen('Título que aparece',this.href); return false"> Seu link </a>
******************************************************************************
Janela popup dinâmica ( dinamic popup window )
function NovaJanela(mypage, myname, w, h, scroll, r) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+r+''
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus();
}
}
Player simples ( simple player )
var UniqueID = 314 // Make each link open in a new window
var newWinOffset = 0 // Position of first pop-up
function PlayerOpen(soundfiledesc,soundfilepath) {
PlayWin = window.open('',UniqueID,'width=320,height=120,top=' + newWinOffset +',left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
PlayWin.focus();
var winContent = "<html><head><title>" + soundfiledesc + "</title></head><body bgcolor="'#000'">";
winContent += "<b style="'color:#fff;font-size:18px;font-family:Verdana,sans-serif;line-height:1.5'">" + soundfiledesc + "</b>";
winContent += "<object width="'300'" height="'42'">";
winContent += "<param name="'SRC'" value="'">";
winContent += "<param name="'AUTOPLAY'" value="'true'">";
winContent += "<param name="'CONTROLLER'" value="'true'">";
winContent += "<param name="'BGCOLOR'" value="'#FF9900'">";
winContent += "<embed src="'" autostart="'TRUE'" loop="'FALSE'" width="'300'" height="'42'" controller="'TRUE'" bgcolor="'#000'"></embed>";
winContent += "</object>";
winContent += "<p style="'color:#ccc;font-size:12px;font-family:Verdana,sans-serif;text-align:center'"><a href="'">Faça download</a> <span style="'font-size:10px'">(right-click or Option-click)</span></p>";
winContent += "</body></html>";
PlayWin.document.write(winContent);
PlayWin.document.close(); // "Finalizes" new window
UniqueID = UniqueID + 1 // newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower
}
Exemplo :
<a href="endereço da url da música" target="_blank" onClick="javascript:PlayerOpen('Título que aparece',this.href); return false"> Seu link </a>
******************************************************************************
Janela popup dinâmica ( dinamic popup window )
function NovaJanela(mypage, myname, w, h, scroll, r) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+r+''
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus();
}
}
Assinar:
Postagens (Atom)