PDA

View Full Version : Looking for jscheuer1 (Mad Professor)



Cheng
07-08-2006, 07:55 AM
Hi John.

I think you are the one person who can help me out here.
If you could check out this here for me please:

Link (http://www.tommys-service-enterprise.gmxhome.de/Pong%20Supan.htm)

When you click the image in the middle of that page a flash popup opens.
You did help me with this script before.
Now after I fixed the dotted line around ActiveX content in IE I have this problem.
The flash popup is not centered.
I mean sometimes it is and sometimes it is not.
Mostly it is not when the page is open in full window mode.
Probably got something to do with the starfield background java script I think but I'm not sure.
Could you please have a look at the script and help me to fix it so the popup will be always centered.

Thank you so much in advance.
Cheng

BLiZZaRD
07-08-2006, 08:22 AM
This question is a lot different than the other one(s) you have asked...

Which one is you want the answer for? :p

Cheng
07-08-2006, 08:43 AM
Hi BLIZZaRD.

Thanks for your reply again.
Yes it is different as I'm trying a few different things right now.
Until I'm not able to replace the SWF files by GIF images, I need the flash poupups to work properly.
Right now they are sometimes centered and sometimes not.
Most of the time when they are not centered it helps to refresh the page with ctrl+F5 and then they are centered.
There is probably a conflict somewhere.
Are you able to fix this?
Would be great if you could.
I addressed jscheuer1 because he definitly can do this.
But if you can help instead I would very much appreciated as well.

Thanks again.
Cheng

Cheng
07-08-2006, 08:48 AM
In addition to the post above I must say that when I open the page in 1024/768 there is mostly no problem but when I open full screen in 1440/900 then the popup is out of place.

BLiZZaRD
07-08-2006, 11:47 AM
Okay, I think I fully understand you now.

Your problem is a common one with centering elements, and is a constant battle with designers. There is no simple answer, because of differences in browsers, screen resolutions, Monitor sizes, etc etc etc

However, I believe your answer lies in CSS. I know there was a thread in the CSS forum here about a fix for browser centering compatability.

Run a search for it. I will look also, and if I find it I will link to it for you.


<edit>
After a quick search I couldn't find the exact thread I was speaking of, but one of these may help, have a look:

http://www.dynamicdrive.com/forums/showthread.php?t=9202

http://www.dynamicdrive.com/forums/showthread.php?t=6648

http://www.dynamicdrive.com/forums/showthread.php?t=4735

Cheng
07-08-2006, 12:59 PM
Hi BLIZZaRD.

Thanks again but this is way to heavy for me.
I'm not a webdesigner and I'm not familiar with CSS as well.
The popups were working fine before I fixed the dotted line around the flash content.
I really appreciate your help but I need someone to point out the right script for me or at least tell me exactly where and what to fix.
Otherwise I'm lost.
That's why I was asking in the 1st place on how to do the same popups with GIF images instead of flash popups.
It is possible as I have seen it many times.
If I could find a tutorial on that I probably could manage but I can't find one.

Thanks again very much.
Cheng

Cheng
07-09-2006, 08:37 AM
Hi.

I think I found the conflict.
As I thought it is about the fix for the dotted Line in IE that I think causes the problem.
Maybe you have an idea how to fix the conflict.
The javascript file that causes this is attached and this is the script inside the html page below the last object on that page:


<script type="text/javascript" src="ieupdate.js"></script>

I think for someone who knows what he is doing it's just a small modification.

Here again the link where the popup is not always centerd because of the javascript:

Link: (http://www.tommys-service-enterprise.gmxhome.de/Pong%20Supan.htm)

Hope someone can help.

Thanks in advance.
Cheng

BLiZZaRD
07-09-2006, 09:13 AM
Eh, sorry buddy I am no more help. I have looked at this every way I know how and the pop up always shows up centered to me. I have tested in FireFox (1.0.6 and 1.5.2) IE5, IE6, and Konquerer.

The image always shows up in the same place. I even checked on a 14 inch CRT monitor, a 14" LCD, 15" LCD and a 21" LCD all at 800X600 as well as 1024X768

The image was always centered for me. Besides the source code being confusing and messy as hell, I didn't notice anything out of the ordinary :p

Perhaps a screen shot of when it is off center and one when it is centered so I can see what you are seeing?

Other than that I don't know what to tell you.

BLiZZaRD
07-09-2006, 09:24 AM
Looking again, you centerpopup function looks like this:

function centerPopUp(){
var w=window.innerWidth? window.innerWidth : document.body.clientWidth
document.getElementById('flashDiv').style.left=(w-document.getElementById('popup').width)/2+'px'
}

onresize=function(){centerPopUp();jsStarFieldBG_onResize();}


Instead of doing all that, you can get rid of the flash pop up and use a gif like you wanted. just use this for the "on click" action of the pic on the page:



<script language="JavaScript">
function openNewWindow(URLtoOpen,windowName,height,width)
{
windowFeatures ="menubar=no,scrollbars=no,location=yes,favorites=no,resizable=no,status=no,toolbar=no,directories=no";
var test = "'";
winLeft = (screen.width-width)/2;
winTop = (screen.height-(height+110))/2;
myWin= open(URLtoOpen,windowName,"width=" + width +",height=" + height + ",left=" + winLeft + ",top=" + winTop + test + windowFeatures + test);
myWin.document.open();
myWin.document.close();
}
</script>

</head><p><img src="images/this.jpg" onclick="openNewWindow('http://www.wwwhiz.com/lazy_programmer/index.html','windowname',400,400)">



Changing the addresses to your gif image of course.

Cheng
07-09-2006, 11:15 AM
Hi BLIZZaRD.

The script you gave for the GIF images is not what I want but still thanks.
I got now what I was looking for.
The GIF popups should look like this:

Link (http://www.tommys-service-enterprise.gmxhome.de/test.htm)

At least I want them that way.
Still it would be nice if somehow the conflict from that external javascript could be fixed.
Attached are 2 screenshots from when the flash popup is centered and when it is not.
This conflict will be only in IE6 I guess.

I'm happy with GIF popups now.
If you want the script let me know and I posted for you.

Thanks again.
Cheng

BLiZZaRD
07-09-2006, 11:47 AM
Well, I see now what you are talking about, but I still can't recreate the problem.

I haven't tried with java/javascript turned off though...

Perhaps you have them turned off on your browser?

I will test when I get a moment.

Cheng
07-09-2006, 12:02 PM
......I think I have Javascript enabled but I'm not sure.
Where I have to look if it is turned on or off?
Anyway the conflickt is the external javascript to get rid of the dotted line in IE6 for ActiveX content because if I remove it it works.
Still let me know where to turn java on and off please.
How you like the GIF popup solution?
Nice one isin't it?.......so long.......Cheng

Cheng
07-09-2006, 02:44 PM
........here is another example.

Flash PopUp with External Script (http://www.mbs-paper.com/flashpopup/popup1.htm)
(sometimes not centered)

Flash PopUp without External Script (http://www.mbs-paper.com/flashpopup/popup.htm)
(always centered but dotted line around flash content)

Sometimes when I open the page with external script it is centerd but then resizing the window and the popup is out of place.

There is definitly a conflict with the external javascript, I think it got something to do with object tags.

By the way my javascript is enabled.
Disabled nothing will work at all.

I hope you can help me fix the conflict.

Thanks a lot.......Cheng.......

jscheuer1
07-09-2006, 03:06 PM
Mad Professor John here;

Looks close enough to me. Your clickable image isn't centered on the page, perhaps that is what makes it look off center when the pop up appears.

Cheng
07-09-2006, 05:06 PM
Hi John.

Thanks for your reply.
Can you help me to fix the conflict?
That would be great.

Thanks again.
Cheng

jscheuer1
07-10-2006, 04:59 AM
Well that dotted line thing is IE only. Some stupid security thing they've set up. You'll have to be more specific about what circumstances cause the external pop up to be off center as, playing around with it, I couldn't get it to misbehave.

jscheuer1
07-10-2006, 06:45 AM
I played around with this a bit more and I see now what seems to throw it off. It happens when you click on the popup link before the page is fully loaded. I don't know how to test this thing out locally so, I can only guess at what might be an effective strategy but, this has a good chance of working:

1 ) Get rid of the onload and onresize statements from the page, give the popup link an id and change its href like so:


<a id="poplink" href="javascript:void(0);"><font color="#FFFF00">popup</font></a>

2 ) Change the external script to look like so:


theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++) {
theObjects[i].outerHTML = theObjects[i].outerHTML;
}

onload=centerPopUp;
onresize=function(){centerPopUp();};

document.getElementById('poplink').href="javascript:popup.GotoFrame(1);";

I also notice that the page doesn't work at all in FF or Opera. Other modifications would be needed, most likely, to correct that.

Cheng
07-10-2006, 06:49 AM
Hi John.

Yes this is an IE problem.
The popup in the page with the external script file is only out of center when I try to open the popup in a downsized window.
If the window is opened in full mode the popup is centered.
In a small window when it is out of center expanding the window to full will center the popup reducing and the window again and the popup is out of center again.
Refreshing the page one time and everything is ok.
Also if I remove the line in the html that links to the external script fixes it as well.
Maybe if you look insde the external script will help.

Here again the two links to compare the pages>

Flash PopUp with External Script (http://www.mbs-paper.com/flashpopup/popup1.htm)

Flash PopUp without External Script (http://www.mbs-paper.com/flashpopup/popup.htm)

This is script that links to javascrpt ( below the last object tag:


<script type="text/javascript" src="ieupdate.js"></script>

The script file is attached with two screenshots and were I noticed that when the popup is out of center the grey status bar down below says Unknown Zone intead of Internet.

Hope that helps.

Thank you very much.
Cheng

PS
I also noticed that with the external script the page sometimes wont stop loading even though all the content is present already.

jscheuer1
07-10-2006, 06:51 AM
I think we just cross posted, go back and look at my most recent response.

Cheng
07-10-2006, 07:02 AM
.......I did change it as you said but now even after refreshing the page the popup will be out of center.
The loading problem is still there as well and shows Unknown Zone instead of Internet down below to the right.
If I view the source code it says :


<script language="JavaScript">
<!--

function SymError()
{
return true;
}

window.onerror = SymError;

//-->
</script>

This code is not in the original html file I uploaded and I think that's the mistake......

jscheuer1
07-11-2006, 06:35 AM
.......I did change it as you said but now even after refreshing the page the popup will be out of center.
The loading problem is still there as well and shows Unknown Zone instead of Internet down below to the right.
If I view the source code it says :


<script language="JavaScript">
<!--

function SymError()
{
return true;
}

window.onerror = SymError;

//-->
</script>

This code is not in the original html file I uploaded and I think that's the mistake......

Some WYSIWYG editors add that to pages without asking you if you want them to or not.

Cheng
07-11-2006, 06:58 AM
Hi John.

Is there a way to change the code somehow so it will work?
If you need the files I can put them on a server so you can get to them.
I mean FTP.
Please let me know.

Thank you.
Cheng

jscheuer1
07-11-2006, 07:53 AM
I would probably need that, yes. I can guess all I want to but, in my experience, especially where object/embeds with controls and these new IE workaround code patches are concerned, experimentation is required. Just as an example, I recently put a QuickTime .mov up for a client and discovered, quite by accident, that actually writing an invalid image tag as a preface to the object/embed tag made the controls work like they used to before this bogus security feature was added. The trouble wasn't so much getting rid of the dotted line but, once I had done that, the controls no longer configured themselves as instructed in the tag. Something similar may or may not be at work here. I think the real problem here is devising a method that will be certain to wait until everything else is loaded before allowing the user to click for the pop up.

Cheng
07-11-2006, 08:15 AM
Hi John.

Here are the files before your 1st modification.

FTP Link (ftp://www.mbs-paper.com/mb/mbs-paper.com/incoming/popup/)

Just copy the files and save them whereever you like on your PC.
You also can copy and paste your modified files in there or just drag and drop them in there.
If you need something else please let me know.
The problem ist that sometimes the loading proccess wont stop at all.
As you will see now the conflict is only online, offline it is working as it should.
I appreciate your help very much.

Thanks again.
Cheng

jscheuer1
07-11-2006, 03:31 PM
What's wrong with this:

http://home.comcast.net/~jscheuer1/side/cheng/popup1.htm


<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>popup</title>
</head>

<body bgcolor="#000000" text="#ffffff">

<p align="center"><a href="javascript:popup.GotoFrame(1)"><font color="#FFFF00">popup</font></a></p>

<div align="center">
&nbsp;</div>

<p align="center">&nbsp;</p>

<div align="center" style="position:absolute;width:100%;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0"
id="popup" width="350" height="175">
<param name="movie" value="popup.swf">
<param name="bgcolor" value="#FFFFFF">
<param name="quality" value="best">
<param name="wmode" value="transparent">
<param name="allowscriptaccess" value="samedomain">
<embed type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
width="350" height="175"
name="popup" src="popup.swf"
bgcolor="#FFFFFF" quality="best"
wmode="transparent"
swLiveConnect="true" allowScriptAccess="samedomain"
></embed>
</object>
</div>
Other stuff on the page
<script type="text/javascript" src="ieupdate.js"></script>
</body>

</html>

Note: javascript:popup.GotoFrame(1) appears only to be valid in IE.

Cheng
07-11-2006, 06:39 PM
Hi John.

Thanks a lot.
I knew if someone can do it than it's you.
I tried in other javascript forums as well but without luck.
Great job!
I'm only a little confused with the layer the one the flash content is placed in.
If I'm adding content to the page I must bring the layer into postion where I want the popup to be.
So I have to center the layer and set the height of the popup is that correct?
But it's working great so far.
Again this was possible because of you.

Thanks again very much.
Cheng
PS
I hope one day I can return the favor somehow.

jscheuer1
07-11-2006, 09:17 PM
Well, that's really a layout issue. The way it is now, the popup container should cover anything beneath it due to its absolute positioning. By giving the popup container no height dimension, it should assume the height of the popup in some browsers and have an effective layout height of zero in all browsers. This will make links underneath it unclickable in some browsers unless they are:

style="position;relative;z-index:1;"

The fact that the popup container is position absolute removes it from the flow of the page, other stuff will appear where it would have if the popup wasn't there.

The real key here is knowing what not to specify. You don't want to specify top or left for the popup container, then centering may no longer be automatic. Even the width:100% may not be required, as a division usually spans the entire page. I didn't think to try that.

Cheng
07-12-2006, 04:35 AM
Hi John.

The way you modified it right now wont let a link work that is placed underneath the layer.
The code you mentioned:


style="position;relative;z-index:1;"

Will this work in IE so that there can be a link underneath the layer?
If this could be done then it would be usable in all stuations I guess.
But I don't want to bother you much more with it as it is working for what I need it at the moment.

Thanks again.
Cheng

jscheuer1
07-12-2006, 05:54 AM
That is one thing relative and absolute positioning combined with z-index are for. By making something relative or absolute position, it allows you to specify a stacking order or z-index, z-index:1 will place an element with either of these types of positioning above other relative or absolute positioned elements with no z-index specified (the default z-index is zero). Using absolute positioning takes something out of the flow of a document, relative position does not. By not specifying top or left with position, the elements will fall where they appear in the code, with relative elements 'taking up space' and absolute ones just sort of 'being where they are' without filling up any specific block of space.

Cheng
07-12-2006, 06:28 AM
Hi John.

The whole subject JavaScript seems like science to me.
As I consider myself just an average PC user.
I'm really happy that you helped me get it working.
I think I have to spend some more time to understand all this but you brought me quiet a bit closer already.

Thanks again very much.
Cheng

jscheuer1
07-12-2006, 06:34 AM
You're welcome but, that last bit about stacking and positioning isn't javascript at all, it is style (often called css style, or just css).