Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Galera to usando o submodal e to querendo fazer ele carregar assim que o usuario loga .. alguém tem ideia de como eu posso fazer isso automaticamente no site ..
pelo exemplo que eu peguei a chamada dela ta assim..
<button onclick="showPopWin('modalcontent.html', 400, 200, null);">show modal window button</button>
abaixo segue o link do submodal.
http://gabrito.com/files/subModal/
beleza.
tmferreira, tentei mas infelizmente não funcionou ..
seuge abaixo o arquivo submodalsource.js
/**
* This derivative version of subModal can be downloaded from http://gabrito.com/files/subModal/
* Original By Seth Banks (webmaster at subimage dot com) http://www.subimage.com/
* Contributions by Eric Angel (tab index code), Scott (hiding/showing selects for IE users), Todd Huss (submodal class on hrefs, moving div containers into javascript, phark method for putting close.gif into CSS), Thomas Risberg (safari fixes for scroll amount), Dave Campbell (improved parsing of submodal-width-height class)
*/
// Popup code
// Pre-defined list of tags we want to disable/enable tabbing into
// If using Mozilla or Firefox, use Tab-key trap.
/**
* Override the loading page from loading.html to something else
*/
/**
* Initializes popup code on load.
*/
// default width and height
// Parse out optional width and height from className
if (endIndex < 0) {
endIndex = this.className.length;
}
var clazz = this.className.substring(startIndex, endIndex);
params = clazz.split('-');
if (params.length == 3) {
width = parseInt(params[1]);
height = parseInt(params[2]);
}
showPopWin(this.href,width,height,null); return false;
}
}
}
}
addEvent(window, "load", initPopUp);
* /***
@argument width - int in pixels*
@argument height - int in pixels*
@argument url - url to display*
@argument returnFunc - function to call when returning true from the window.*
/*
function showPopWin(url, width, height, returnFunc) {
gPopupIsShown = true;
disableTabIndexes();
gPopupMask.style.display = "block";
gPopupContainer.style.display = "block";
centerPopWin(width, height);
var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10);
gPopupContainer.style.width = width + "px";
gPopupContainer.style.height = (height+titleBarHeight) + "px";
gPopFrame.style.width = parseInt(document.getElementById("popupTitleBar").offsetWidth, 10) + "px";
gPopFrame.style.height = (height) + "px";
gPopFrame.src = url;
gReturnFunc = returnFunc;
// for IE
if (gHideSelects == true) {
hideSelectBoxes();
}
window.setTimeout("setPopTitleAndRewriteTargets();", 100);
}
//
if (gPopupIsShown == true) {
if (width == null || isNaN(width)) {
width = gPopupContainer.offsetWidth;
}
if (height == null) {
height = gPopupContainer.offsetHeight;
}
// scLeft and scTop changes by Thomas Risberg
var scLeft,scTop;
if (self.pageYOffset) {
scLeft = self.pageXOffset;
scTop = self.pageYOffset;
} else if (document.documentElement && document.documentElement.scrollTop) {
scLeft = document.documentElement.scrollLeft;
scTop = document.documentElement.scrollTop;
} else if (document.body) {
scLeft = document.body.scrollLeft;
scTop = document.body.scrollTop;
}
gPopupMask.style.height = fullHeight + "px";
gPopupMask.style.width = fullWidth + "px";
gPopupMask.style.top = scTop + "px";
gPopupMask.style.left = scLeft + "px";
window.status = gPopupMask.style.top + " " + gPopupMask.style.left + " " + gi++;
if (topMargin < 0) { topMargin = 0; }
gPopupContainer.style.top = topMargin + "px";
gPopupContainer.style.left = (scLeft + ((fullWidth - width) / 2)) + "px";
}
}
addEvent(window, "resize", centerPopWin);
//addEvent(window, "scroll", centerPopWin);
window.onscroll = centerPopWin;
*/***
/*
function hidePopWin(callReturnFunc) {
gPopupIsShown = false;
restoreTabIndexes();
if (gPopupMask == null) {
return;
}
gPopupMask.style.display = "none";
gPopupContainer.style.display = "none";
if (callReturnFunc == true && gReturnFunc != null) {
gReturnFunc(window.frames["popupFrame"].returnVal);
}
gPopFrame.src = gLoading;
// display all select boxes
if (gHideSelects == true) {
displaySelectBoxes();
}
}
*/***
Sets the popup title based on the title of the html document it contains.*
Also adds a base attribute so links and forms will jump out out of the iframe*
unless a base or target is already explicitly set.*
Uses a timeout to keep checking until the title is valid.*
/*
function setPopTitleAndRewriteTargets() {
if (window.frames["popupFrame"].document.title == null) {
window.setTimeout("setPopTitleAndRewriteTargets();", 10);
} else {
var popupDocument = window.frames["popupFrame"].document;
document.getElementById("popupTitle").innerHTML = popupDocument.title;
if (popupDocument.getElementsByTagName('base').length < 1) {
* if (aList.target == null) aList**.target='_parent';*
}
var fList = window.frames["popupFrame"].document.getElementsByTagName('form');
for (i = 0; i < fList.length; i++) {
* if (fList.target == null) fList**.target='_parent';*
}
}
}
}
// Tab key trap. iff popup is shown and key was [TAB], suppress it.
// @argument e - event - keyboard event that caused this function to be called.
}
// For IE. Go through predefined tags and disable tabbing into them.
function disableTabIndexes() {
if (document.all) {
* gTabIndexes** = tagElements[k].tabIndex;*
tagElements[k].tabIndex="-1";
i++;
}
}
}
}
// For IE. Restore tab-indexes.
function restoreTabIndexes() {
if (document.all) {
* tagElements[k].tabIndex = gTabIndexes**;*
tagElements[k].tabEnabled = true;
i++;
}
}
}
}
*/***
** Thanks for the code Scott!*
**/*
* document.forms**.elements[e].style.visibility="hidden";*
}
}
}
}
*/***
**/*
* document.forms**.elements[e].style.visibility="visible";*
}
}
}
}
*/***
X-browser event handler attachment and detachment*
@argument obj - the object to attach event to*
@argument evType - name of the event - DONT ADD "on", pass only "mouseover", etc*
@argument fn - function to call*
/*
function addEvent(obj, evType, fn){
if (obj.addEventListener){
obj.addEventListener(evType, fn, false);
return true;
} else if (obj.attachEvent){
} else {
return false;
}
}
*/***
Code below taken from - http://www.evolt.org/article/document_body..._more/17/30655/ **
Modified 4/22/04 to work with Opera/Moz (by webmaster at subimage dot com)*
Gets the full width/height because it's different for most browsers.*
/*
}
}