Click to See Complete Forum and Search --> : browser window, onBlur Problem
mpalinkas
12-04-2003, 11:45 AM
The site is www.acuitylab.com/insight
then hit Weddings button.
When one of the thumbnail images on the bottom is clicked, a pop-up window opens and displays the image larger. I used <body onBlur="self.close()" > to make sure that if someone clicks on one thumbnail and then another on the main page, that only one pop-up will be open at a time.
The problem that I am having is that on some versions of IE, the next and back arrows in the pop-up make the window close.
I have talked to soooo many people about this and there seems to be no simple solution. I don't want to take out the onBlur because I don' t want the user to have 50,000 pop-ups open. Someone suggested to have the popup always come to the front (and reuses the same window) if they click another link by naming the window the same for all thumbnails.
This sounds appropriate to me, if there is no other solution... but will it work and if so, how do I go about doing this? (I am a bit of a newbie).
Thanks!
Mindy
TheBearMay
12-04-2003, 12:01 PM
Reusing a window is accomplished by giving it a name in the window.open command, ie. window.open(ImageUrl,windowName,optionalFeatures). If you attempt to open another window with the same name it will reuse the first instance.
mpalinkas
12-04-2003, 12:06 PM
Thanks for your response.
I guess what I am really looking for is a way to make the pop-up not disappear when the next arrow is clicked. Is this possible?
TheBearMay
12-04-2003, 12:21 PM
Are the next and back browser buttons necessary in the popup? If not you can keep them from being present in the popup when you create it.
Pittimann
12-04-2003, 12:31 PM
Hi!
To TheBearMay: Mindy is not talking about the browser buttons - in the popup, she's having her own arrows to move to the next or the previous photo...
To mpalinkas: take away the onblur and it will work. I didn't check your entire popup code (it dissapeared several times when I wanted to get the source code - I'm using IE 6).
After having named the popup window (you do so, but from the main window, every possible popup has a different name) your prob should disappear...
Cheers - Pit
Pittimann
12-04-2003, 12:40 PM
Hi!
I checked the entire popup code in the meantime.
If you want things to work, you have to go through all files (:() - like amy_thomas_1.html etc. - opened by clicking one of the arrows. That will be boring, but the only way.
Eliminate ALL unblurs from the body tags - poor mpalinkas!
Cheers - Pit
mpalinkas
12-04-2003, 12:42 PM
Thanks Pit!
Unfortunately, I put in the onBlur to clear up ANOTHER problem... the problem that several users don't know to hit the arrows (?) and go back to the main page and hit another thumbnail... THEN they end up with 50,000 pop-up windows there by the time they are done.
Pittimann
12-04-2003, 12:49 PM
Hi!
No! The suggestion "somebody made" (your first post) and the one made by TheBearMay will work.
On the main page you shouldn't use:
...onMouseUp="MM_openBrWindow('amy_thomas_1.html','amy1','width=520,height=450')" ...
...onMouseUp="MM_openBrWindow('amy_thomas_2.html','amy2','width=520,height=450')" ...
and so on and so on.
Example to avoid 50000 popups:
...onMouseUp="MM_openBrWindow('amy_thomas_1.html','alwaysTheSameName','width=520,height=450')" ...
...onMouseUp="MM_openBrWindow('amy_thomas_2.html','alwaysTheSameName','width=520,height=450')" ...
That is what "somebody" and TheBearMay were talking about.
Cheers - Pit
mpalinkas
12-04-2003, 12:57 PM
Pit!
You are so awesome to be so patient with me. I did try that and the problem that I had was that the pop-up stayed behind the main page, so you couldn't tell that it was there (see... another problem is that I am on a mac, my client is on a PC... so I don't see any of these problems that he does. argghhh).
someone else suggested this same thing and also suggested using <body onLoad="self.focus()"> in the pop-ups... will this work?
There is a certain beauty to Find/Replace in Dreamweaver...:)
Thank you again.
Mindy
Pittimann
12-04-2003, 01:04 PM
Hi!
No reason for that suggestion not to work (even though there are different ways to accomplish this)!
Before this is out of my mind: we were talking about "the main window" - bear in mind that each of your couples (weddings) stands for an own main page - lot of work to be done...
Cheers - Pit
mpalinkas
12-04-2003, 01:14 PM
Pit,
I guess that I have no choice but to dive in and try it!
I will let you know what happens.
Thanks sooooo(with 50000 "o"s) much!
Mindy
Pittimann
12-04-2003, 01:22 PM
Once more me -
before you start changing all these files, it's better to change one or two pages containing a single photo (for the popup) for let's say two weddings. Then check, if everything is fine for you.
If so => :) - if not => :( (means: don't continue, post again...)
All the best - Pit
mpalinkas
12-04-2003, 01:34 PM
Pit.
I tried it out on the Amy & thomas pages in Weddings.
One problem. I can't tell if it is working on my mac (because it worked all along). Can you look for me www.acuitylab.com/insight and then hit the Weddings button.
You are so GREAT!
Best,
Mindy
Pittimann
12-04-2003, 01:50 PM
Hi!
I did so - the popup appeared like before. I clicked the thumbnail on the left. In the popup-code there is still the onblur in the body. And (wasn't like that before) the MM_swap... functions create errors:
-----------
<td bgcolor="#9C938C" width="30"><!-- #BeginEditable "back" --><a href="amy_thomas_16.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','../../images/back_arrow_02.gif',1)"><img name="Image4" border="0" src="../../images/back_arrow_01.gif" width="25" height="56"></a><!-- #EndEditable --></td>
<td width="443" align="center" bgcolor="#9C938C"><img src="../../images/use.gif" width="229" height="25"></td>
<td bgcolor="#9C938C" width="15"><!-- #BeginEditable "next" --><a href="amy_thomas_2.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image30','','../../images/next_arrow_02.gif',1)"><img name="Image30" border="0" src="../../images/next_arrow_01.gif" width="25" height="56"></a><!-- #EndEditable --></td>
-----------
For a test I removed the onMouseOut's and Over's - then it worked. You must have modified something else...
Cheers - Pit
Pittimann
12-04-2003, 02:10 PM
Hi!
Got the reason for the "MM_swap..." error:
Check the code for the .htm file displaying the first image. You'll find:
---
<script language="JavasScript">
<!--
self.focus()......
---
quite at the top of the code.
remove the "s" in "JavasScript"; better replace the line by:
<script type="text/javascript">
Better to move the self.focus() there on top of the page as the replacement for the onblur still in the body tag -> onload="self.focus()"
Hope, that helps - Pit
mpalinkas
12-04-2003, 02:23 PM
Pit.
Oops... I took out the onBlurs (duh), and the only thing that I changed was I put this at the begining of my script...
(I didn't alter anything else... wierd)
<script language="JavasScript">
<!--
self.focus()
Can you test again.
(do you do all of this for free... that is nuts. I should pay you)
-Mindy
Pittimann
12-04-2003, 02:36 PM
Sorry - had a call because of a concert I was supposed to participate in tomorrow.
The JavasScript is still there, the onblur has gone.
Because of this "s", the functions called onmouseover and -out create errors and due to that the arrows don't work...
Cheers - Pit
mpalinkas
12-04-2003, 02:42 PM
I think that I just don't need rollovers there! That's it. I will remove them and may ask you to check one more time.
A concert... That is great! (what kind?)
mpalinkas
12-04-2003, 02:47 PM
Pit,
I took all of the rollovers out. that shooooo(with 50000 "o"s)uld do it.
I hope so!
Pittimann
12-04-2003, 02:50 PM
Shall I tell that to someone I identified as a lady :rolleyes:?? OK - we call it "housewife reggae" :).
BTW - why not remove that "s"??
Well, removing the rollovers wouldn't make things looking worse - I couldn't identify a visible effect...
Tell me when you did your stuff and I'll check again.
Cheers
mpalinkas
12-04-2003, 02:53 PM
"Housewife Reggae" is OKAY (?althoug I don't quite get it?). Do you play an instrument?
The stuffs up... I wasn't sure about the "s" (and what you meant)
Pittimann
12-04-2003, 02:53 PM
It works on my PC (win98 IE 6).
You only changed the no1.htm, isn't it??
When I use the forward arrow to get to no2.htm, the sh.. still comes up...
Cheers - Pit
Pittimann
12-04-2003, 03:00 PM
I hope, not to be banned because of going off topic:
I'm a singer in a band playing mainly reggae - we call it "housewife-reggae" because quite a number of our songs are quite nice, if you listen to them while vacuum cleaning, washing dishes etc... :p
The "s" means: in your code there is:
<script language="JavasScript">...
this (red) "s" destroyes everything in the script...
C. u. (read you) - Pit
mpalinkas
12-04-2003, 03:02 PM
Definitely don't want to be banned. You have been way too helpful!
Thank you soooooo much (without the "s") I will take it out and then it (s)hould work!
Pittimann
12-04-2003, 03:11 PM
Well - if you like, I can do another check. During the coming hour I might be a bit less spontanuous - have to prepare some salad - fry half an ox etc. (too long without food and local time = 10:11 o'clock p.m.).
Good luck! Pit
Pittimann
12-04-2003, 03:25 PM
While my salad's dessing is getting more tasty (taste of onions and garlic getting absorbed by vinegar and oil):
You made a tiny mistake:
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
Please just make it:
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
BTW - you owe me a sip of water for every post. But I don't want to leave the impression, that I am somebody who wants to increase his post count. Please do me one favour: delete this thread after everything turned out to be ok...
Cheers - Pit
Pittimann
12-04-2003, 03:33 PM
Got it!
mpalinkas
12-04-2003, 03:38 PM
That is too wierd. I was just watering my trees inbetween creating sloppy java(s)Script and I was thinking (outloud) how precious water is ( I live in the high desert of New Mexico)!
Okay, I think that all is copacetic(sp?) now.
:D
Pittimann
12-04-2003, 03:45 PM
Shortage of English alert:
copacetic = neither in memory, nor in dictionary!
The town I live in has the reputation of beeing (what we say in German) a rain hole.
You don't owe me water or something else! Fine, you made it work...
Cheers
P.S. Delete thread NOW!
mpalinkas
12-04-2003, 03:57 PM
it won't let me!
Pittimann
12-04-2003, 04:08 PM
What - delete?
It is possible, but not really necessary. I was 75% joking, 25% serious.
Actually, my proposal is based on the fact, that all these posts dealt with a very individual case - yours. No code posted helpful for others plus something like chat between us (less important, but not the purpose of these forums).
I became a member here 3 weeks ago and I have no idea about server and software capacities - so I just thought, if our conversation helped you => very nice, but nobody else can take something out of that...
Did you fix the other files?
My ox is almost alright - I'll have a look at it
Bye - Pit