Really annoying coding question

Okay . . . this has stumped my techie of a mother, so ti should be interesting to see how the TM handle it.

I want to make a link on a word (easy part . . . I can do that with my feet) and have that link be a pop-up window (can’t do yet, but am learning) that goes on the right side of the screen and is roughly the height of the “The Straight Dope” blue picture on the top of this page, but half the length. And I want this to appear roughly halfway down the screen and contain the definition to some word I’m going to use that would otherwise require a dictionary.

So my question to y’all is: how do I do the whole sizing and screen-placement thing?

Any help possible is greatly appreciated.

One little thing I forgot while posting this . . .

I also want a link or whatever in the pop-up window that closes said window.

A touch of javascript would do it.
Just copy the code on one of those annoying sites that has similar pop-ups. aol.com, or netscape.com for example.

iampunha - j’ai lu votre .sig - vous etes français? Ma mère a emigre aux Canada du France a l’age de trois ou qautre ans avec mes grandparents.

You cannot do this through an href link opening a new window. When you open a pop up window or spawn a new browser window, the O/S gets to decide where to place the window.

However, you can probably accomplish the same thing with dynamic html and style sheets. I’ve created pages that display a box when the mouse pauses over an image. You could do something similar on a word. The code is a little complicated to post here so I’ll see if I can find a link that describes how to do this.

Start here for a good tutorial on text positioning.

http://htmlgoodies.earthweb.com/beyond/positioning.html

Mais oui, je suis français. Ma grand-mère est née à Paris il y a un mois avant le commencement de la Guerre Grande. Elle s’est marié avec mon grand-père 1937, et ils sont arrivés aux états-unis le même ans.

Eng. translation: Of course I am french. My grandmother was born in Paris one month before the start of the Great War. She married my grandfather in 1937, and they arrived in the US the same year.

thewiz: thanks for the link. I will look later to see if i can use that.

Vous penser peux-t’etre y retourner?

Parce-que ma mere etait ne en France, j’essaye de la pousser de recupere ca citoyennete Francaise - je veux devenir citizen aussi…

Je m’excuse, mais c’est trop compliquer pour moi d’ajouter les accents alors j’ai arreter.
J’espere aussi que t’excuse mes erreur typographique, j’ai pas beaucoup pratiquer le francais les dernier cinq ou six annee.

Javascript can do positioning too. In that case, if the href was to a javascript function, that function could then create and position the pop-up. That’s really the most common way it’s done.

You can do a popup really easily like this:


<a href="javascript:window.open('http://www.something.com/file.html',
'windowname',
'width=400,height=200,status=yes,resizable=yes');">word</a>.

The first parameter is the URL to the file for that window, the second is the name of that window, and the third is the width, height, and status of the window.

I’m not sure about positioning it at the top-right, though.

To make a link in the new window that will close itself, do this:


<a href="javascript:window.close()">close</a>

There is a window.moveBy function, but that doesn’t allow you to set original position.
Hm.
Howzabout maximizing the window, then resizing it smaller, then using moveBy? :slight_smile:
That’d be annoying though, and for what you’re doing, it doesn’t seem that critical that the window be in a particular place.

I agree. As long as the popup has an obvious “close” button i don’t think it matters where it shows up. I forgot to mention in my last example that the “window name” parameter can do cool things. If every word that has a definition uses the same window name parameter, and if the user leaves the definition window open, the new definition will be loaded into that same window.

Pour faire les accents, chercher le “character map” si ton ordinateur est “windows”. Si c’est pas ça, je n’ai rien à dire pour t’aider.

Ce serait stupide (je ne dit rien de la raison pour ça), essayer à apprendre “citoyen de la France” . . . je n’ai aucun raison pour essayer à cela.

Tes erreurs ne sont pas évident à moi (moins le “t’excuse” . . . tu t’excuse . . . c’est une verbe reflexive), mais il y a deux ans que j’étudie le français. Si tu veux practiquer, on peut écrire un email à moi, et si tu as voulu, je le responderais en français, si c’est ton esprit.

Eh bien, j’avais peut-être un ans et 13 ans quand je suis retourné à France. Quand j’étais là quand j’avais 13 ans, je suis allé aussi à L’Italie, L’Ireland (je ne me souviens pas le mot français pour “Ireland”) et la luxembourgh.

Eh bien, c’est assez en français pour une poste.

Okay . . . but what I want to do is have a pop-up html file from a disk (and hence not www but A:/) . . . I was not able to get a new window to form from the A drive, but I was from http://www.

How would I make a link using, say, the text “click here to close this window” and have that close? with hmtl coding, I haven’t been around it long enough to know what to change and such.

Are you sayiong you want to load a file from the user’s hard drive? I’m not sure why you woujld want to do that, but you do it like this: <a href=“file:///A/dir/file.html”>

<a href=“javascript:window.close()”>

Friedo, what I’m doing is a project on a 3.5 inch disk. It’s my “final” project for English, and my final for this really stupid “programming” class in which they’ve basically taught us how to do some things on composer. Composer, IMO, is like trying to hit a fastball with a plastic bat. Yeah, you might make contact, but it ain’t going nowhere anytime soon.

In other related news, I just tried it and got it to work after putting a colon like so: file:///A:/thispage.html, where thispage.html is the page I wanted to load. Nothing superfancy yet, now I get to work on resizing the window, since I want it to be smaller still.

Thanks guys!

Okay . … new problem. I did the javascript open new window bit but tagged it onto a word. When I click on said word, the window pops up, but in the old maximized window the following appears:

“[object Window]”

but without the quotes.

Can any (either) of you explain why this happens and how to fix it?

Also . . . the pop-up window currently goes to about an inch and a half left of the left corner . . . same height, though. What would to code be to move it, say, 50 down and 500 across?

Thanks so much for your help:)

that’s the window.moveby (takes x,y values in pixels) function. Keep in mind, though, that the window going there is probably some Windows default that got set the last time you manually moved a window to that position. It won’t be the same for everyone.

Here’s what I have: <a href=“javascript:window.open(‘file:///A:/thispage.html’,‘thispage’,‘width=300, height=100, status=yes,resizable=yes’);”>word</a>

Now, where the devil do I put the "windows.moveby (50, 150), " bit?

You don’t hafta use .moveby() (in fact you would be better to use .moveTo()) Try


<a href="javascript:window.open('file:///A:/thispage.html','thispage','width=300,
 height=100, status=yes,resizable=yes left = 200
 top = 300');">word</a>

The left and top attributes are relative to the top left corner of the screen.

i’m working on a more advanced version, if you’re interested.