Advertisement

09.25.2008 at 08:36AM PDT, ID: 23762922 | Points: 500
[x]
Attachment Details

how do i make the modal window display in a different position?

Asked by markmchugh in JavaScript

Tags:

Hi,
My code is attached, how do i make this window display in the top right when the page loads?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.1/scriptaculous.js"></script>
<script type="text/javascript" src="livepipe.js"></script>
<script type="text/javascript" src="window.js"></script>
<script type="text/javascript" src="msg.js"></script>
<style type="text/css">
<!--
#control_overlay {
	background-color:#000;
}
.modal {
	background-color:#fff;
	padding:10px;
	border:1px solid #333;
}
 
-->
 
</style>
<script type="text/javascript">
 
var class_FordMDelegate = Class.create({
 
	initialize: function() {
		this.tabSetArray = new Array();
		this.classOff = "tabs_off";
		this.classOn = "tabs_on";
		this.activeTab = "";
		this.relative = "";
 
		this.ajaxIncrement = 10;
 
		this.imageCounts = {
			"Christina": "268",
			"Matt": "40",
			"Vickie": "135"		};
 
		this.loadedTabs = {
 
		};
 
	},
 
	addTabs: function (tabContainer) {
			$A($(tabContainer).getElementsByTagName("DIV")).each(
					function (item) {
						FordMDelegate.tabSetArray.push(item.id);
					}
				);
 
			this.switchTab($(this.tabSetArray[0]));
	},
 
	switchTab: function (element) {
			dataContainer = element.id + "_data";
			this.activeTab = dataContainer;
 
			for (x in this.tabSetArray) {
				dataElement = $(this.tabSetArray[x] + "_data");
				if (dataElement) {
					if (dataElement.style.display != "none") {
						dataElement.style.display = "none";
					} else {}
 
					if (dataElement != dataContainer) {
						//dataElement.innerHTML = "";
					} else {}
				} else {}
 
				tabElement = $(this.tabSetArray[x]);
				if (tabElement) {
					if (tabElement.className != this.classOff) {
						tabElement.className = this.classOff;
					} else {}
				} else {}
			}
 
			$(dataContainer).style.display = "";
 
			if (this.loadedTabs[dataContainer] != "y") {
				$(dataContainer).innerHTML = "<p><p>.......Loading.......</p></p>";
				owner = element.getElementsByTagName("SPAN")[0].innerHTML;
				this.ajaxRetrieveImages(0, owner, dataContainer);
			} else {}
			element.className = this.classOn;
			new Effect.Fade(element, {from: .6, to: 1, duration: .75});
	},
 
	flashTabs: function () {
			for (x in this.tabSetArray) {
				if (document.getElementById(this.tabSetArray[x])) {
					new Effect.Pulsate(this.tabSetArray[x], {duration: 2, pulses: 3});
				} else {}
			}
	},
 
	getImage: function(id, t) {
		src = $("imageT_" + id).src.replace(/(.*)\/drg_2008\//, "");
		switch(t) {
			case 0:
			default:
				src = src.replace("images/thumb/", "images/original/");
				break;
 
			case 1:
				src = src.replace("images/thumb/", "images/large/");
				break;
		}
		src = src.replace("images", "");
		$("downloadImage").src = "http://www.mechanicmatt.com/local/drg_2008/dlImage.php?getImage=" + src;
	},
 
	ajaxRetrieveImages: function(start, owner, tab) {
 
		//if (this.activeTab == tab) {
			url = "index.php";
			max = this.imageCounts[owner];
			limit = start + this.ajaxIncrement;
			parentObject = this;
 
			if (start <= max) {
				qsHash = new Hash();
				qsHash.set("ajaxImages", "y");
				qsHash.set("start", start);
				qsHash.set("owner", owner);
				qsHash.set("max", limit);
 
				new Ajax.Request(url, {
						parameters: qsHash,
						onSuccess: function(transport) {
							if (start == 0) {
								$(tab).innerHTML = "";
							} else {}
							dynDiv = document.createElement("div");
							dynDiv.innerHTML = transport.responseText;
							$(tab).appendChild(dynDiv);
 
							parentObject.ajaxRetrieveImages(limit, owner, tab);
						}
					});
			}
			else {
				this.loadedTabs[tab] = "y";
			}
		//}
	},
 
	showPreview: function(src) {
		container = $("genericModalImgContainer");
		container.href = src;
		//img = $("genericModalIMG");
		//img.src = element.src;
 
		preview = new Control.Modal(container, {
 
 
				overlayOpacity: 0.75,
				className: 'modal',
				fade: true
		});
 
		preview.open();
 
	},
 
	showInstructions: function() {
		this.relative = new Control.Modal($("instructions"),{
			className: 'modal',
			fade: true,
			overlayOpacity: 0.75,
			closeOnClick: true
		});
 
		helpContent = "<p><strong>Testing</strong></p><input type=\"button\" value=\"Close\" onclick=\"FordMDelegate.relative.close();\" /></p>";
		this.relative.container.insert(helpContent);
		this.relative.open();
	}
});
 
FordMDelegate = new class_FordMDelegate();
 
 
</script>
</head>
<body>
<script type="text/javascript">
		    <!--
		    FordMDelegate.showInstructions();
		    -->
		    </script>
</body>
</html>
[+][-]09.26.2008 at 05:07PM PDT, ID: 22584928

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.26.2008 at 05:08PM PDT, ID: 22584937

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 - Hierarchy / EE_QW_2_20070628