...

View Full Version : "Best" pop-up code to use?



Parsed Twice
07-06-2005, 02:37 PM
Hi all,

I truely don't like to use pop-up windows and have done very well, to date, not having to do so... but a situation has come up and I will need to use a few on some pages.

Question:

Is there a way to code the pop-up in JS but have it still be usefull for those who may have JS turned off? I'm thinking that if the pop-up won't work then a new window would be the next best thing.... If not - what would be a good alternative - maybe another link near by that is a straight link? Is there such a thing as an "html" pop-up (sans JS)?

If the user has a popup blocker in place - another pitfall to the whole pop-up scheme...

Anyway - any suggestions would be appreciated. :)

TP

mattyod
07-06-2005, 02:51 PM
Can you not make the pop ups activated by clicking on a link? As you say a lot of people now have a pop-up blocker of some sort. Pop ups aren't blocked from links and well it's just nice to let the user decide isn't it?

You will still need JavaScript to customise how you want your popped up windows to display but even those without JS enabled will still be able to access the info, they will just get it in a normal browser screen.

Parsed Twice
07-06-2005, 03:16 PM
Can you not make the pop ups activated by clicking on a link? As you say a lot of people now have a pop-up blocker of some sort. Pop ups aren't blocked from links and well it's just nice to let the user decide isn't it?

Yes- I'm sorry, I meant to specify that these pop-up windows would be triggered by a link.


You will still need JavaScript to customise how you want your popped up windows to display but even those without JS enabled will still be able to access the info, they will just get it in a normal browser screen.

Good - what code will do this? Most of the code I'm finding will not display in a full window when clicked by an agent without JS... ?

Thanks
TP

_Aerospace_Eng_
07-06-2005, 03:19 PM
<a href="blah.html" onclick="window.open(this.href,'somename','width=200,height=200,scrollbars=0,menubars=0,toolbars=0,directorie s=0,status=0');return false" target="_blank">Blah</a>


Why are the popups so important anyways?

mattyod
07-06-2005, 03:39 PM
Good - what code will do this? Most of the code I'm finding will not display in a full window when clicked by an agent without JS... ?

I don't think you can. I think most people have JavaScript turned on but what I'm saying is that if you have your script attached to an ordinary link then even those with JS trurned off will still be able to access the information; they will just have to resize/scroll the browser to fit themselves; and well that's their fault :)

It seems to me that you are basically going about it the right way.

_Aerospace_Eng_
07-06-2005, 03:41 PM
Yeah hes wanting a popup code that will work for users with JS enabled but when disabled it will just open the link in a new window. I have provided the code for this.

Parsed Twice
07-06-2005, 04:27 PM
<a href="blah.html" onclick="window.open(this.href,'somename','width=200,height=200,scrollbars=0,menubars=0,toolbars=0,directorie s=0,status=0');return false" target="_blank">Blah</a>


Why are the popups so important anyways?


Excellent! Thank you very much!

PT

mrruben5
07-07-2005, 03:02 PM
http://www.xoops.org/modules/smartfaq/faq.php?faqid=486

paulajackson
07-14-2005, 10:20 AM
Thats great. I was about to post a query regarding this and then found this thread.
Could you also include the code for a "close this window" link to be placed within the pop up? Thanks

Paul

ronaldb66
07-14-2005, 10:31 AM
That would be the little button marked "X" found in the top right of the window: works always, is cross-browser and JavaScript independent. :rolleyes:

mrruben5
07-14-2005, 10:40 AM
LOL :D Indeed, you don't need to provide a close button IMHO, but if you insist:

<img src="x.gif" alt="" onclick="window.close">

_Aerospace_Eng_
07-14-2005, 01:04 PM
LOL :D Indeed, you don't need to provide a close button IMHO, but if you insist:

<img src="x.gif" alt="" onclick="window.close">
missing the ()

<img src="x.gif" alt="" onclick="window.close()">
Of course you can only use a window.close() button if the window was opened using javascript.

paulajackson
07-14-2005, 02:16 PM
:) Okay okay fair enough.

On my webpage I am wanting to have several links, the results of which show up in the same pop up window and not in their own independent pop ups if that makes sense.

Do I use the same code that Aerospace_Eng provided? And also do I just repeat that code for each link and change the link address?

Thanks
Paul

paulajackson
07-14-2005, 02:19 PM
Also....

when the user goes back to the main page and clicks on a link, can the pop up window "maximise" again with the new content?

Thanks

Paul

mentalhorse
07-14-2005, 03:33 PM
i believe to do this you would need to set the target to the same window as before. not as _blank. but as sum other name..
ie. target="newwindow"

paulajackson
07-14-2005, 04:00 PM
Thanks. Have tried that but its still bringing up seperate windows for each link. Am still searching the web for some solution though.

One other thing I've noticed since doing this is that my links now don't work unless you hover over the end of the link word.

www.jacksonline.plus.com/pjtest2/songs.htm

I can't hover over the song titles like I used to. Is there a reason why? Or something I can do to sort it out?

Thankyou

Paul



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum