473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

hot spot links to popup

hi guys,
i have a pic that i have created hot spots on. i want these to
open popups with limited features (eg: no status, no resizable...) any
ideas?

darren
Jul 20 '05 #1
7 5839
"bubipoo" <go*@doodsville.com> skrev :
i have a pic that i have created hot spots on. i want these to
open popups with limited features (eg: no status, no resizable...) any
ideas?


In <head>:
<script LANGUAGE="JavaScript">
<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops =
'height='+h+',width='+w+',top='+wint+',left='+winl +',scrollbars='+scroll+',resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
// End -->
</script>

and on the hotspot:

<area SHAPE=RECT COORDS="216,154,414,296" HREF="1.htm"
ALT="Billede 1"
onclick="NewWindow(this.href,'link','566','400','n o');return
false;" OnMouseOut="window.status=''; return true"
onMouseOver="window.status=''; return true"
onfocus="this.blur()">

You can see it on
http://home13.inet.tele.dk/smedpark/...pup/popup6.htm
(The page is in danish, but look at the source code).
--
Knud
Jul 20 '05 #2
"bubipoo" <go*@doodsville.com> wrote in message
news:yU*******************@news-server.bigpond.net.au...
i have a pic that i have created hot spots on. i want these
to open popups with limited features (eg: no status, no
resizable...) any ideas?


AREA tags support onclick attributes.

You may want to open windows, and specify chrome for them. If the user
doesn't want that to happen they can prevent it. Years of pop-up abuse
have bought use to the point where trying to open a new window with
JavaScript is so error prone and unpredictable that it is not even worth
attempting unless the contents of that window are totally trivial and
unimportant (in which case why bother?). Better to design web sites to
operate within the one window and leave branching into additional window
up to the user (via, say, the context menu). The alternative is so
chaotic these days that the plethora of possible outcomes could hardly
be considered as "designed".

Richard.
Jul 20 '05 #3
Knud Gert Ellentoft <kn******@mail.tele.dk> writes:
In <head>:
<script LANGUAGE="JavaScript">
<script type="text/javascript">
The language attribute is deprecated, and the type attribute is mandatory,
in HTML 4.
<!-- Begin
HTML comments are not necessary in Javascript.
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2; winprops =
'height='+h+',width='+w+',top='+wint+',left='+winl +',scrollbars='+scroll+',resizable=no'
It is worth mentioning that you try to center the new window wrt. the
screen. It will, ofcourse, fail in, e.g., Opera's MDI mode or in browsers
that open new windows in new tabs (e.g., Mozilla in some setups and MyIE2).

It will also look horrible on two-monitor setups, where it will probably
be placed right on the split.
<URL:http://david.us-lot.org/www/dumb/fullscreen.jpeg>

I would use screen.availWidth and screen.availHeight. It won't make
much difference in practice, but I am suggesting to Opera that they
change the availWidth/Height to the size of the MDI window ... because
it would make sense.

Make winprops a local variable too.
win = window.open(mypage, myname, winprops)
If you don't use the "win" variable outside the function, make it a
local variable.
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
Better:
if (win.focus) {win.focus();}
}
// End -->
Not necessary either.
</script>


I also recommend against depending on new windows.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4
In article <ue********************************@dtext.news.tel e.dk>, Knud Gert
Ellentoft <kn******@mail.tele.dk> writes:
In <head>:
<script LANGUAGE="JavaScript">
language attribute is deprecated in favor of type="text/javascript" which is
mandatory in HTML4.0
<!-- Begin
HTML comments are not needed in any modern browser.
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
What does my screen.width and screen.height have to do with the size of a
preferred window?

screen.width for me is 2048
screen.height for me is 768

run those through your script, and you will attempt to get a window that is :

740 wide
184 high

You might want to reconsider your approach.
winprops =

'height='+h+',width='+w+',top='+wint+',left='+win l+',scrollbars='+scroll+ ',resizable=no'win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
Browser detection?
And, what about browsers that support focus() but have an appVersion lower than
4?

}
// End -->


Closing HTML comments following a js comment are not needed.


--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #5
"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:u1**********@hotpop.com...
<snip Lots of good advice.>
win = window.open(mypage, myname, winprops)
If you don't use the "win" variable outside the function,
make it a local variable.


As there are a number of JavaScript capable browsers that do not have a
window.open function I would additionally like to see the above line
wrapped in appropriate tests. Else it will generate an error and deprive
the script the option of controlled fall-back. An - if(window.open) -
test seems like a good starting point, except that Pocket IE apparently
lacks a global 'window' property so even that test will error ("window
is null or not an object!, though Pocket IE does not report errors by
default).

The fall-back for a browser without a window.open function should be
navigation within the same window, so the user can get to see the
content. To achieve that the AREA tag could become:-

<area SHAPE=RECT COORDS="216,154,414,296" HREF="1.htm"
ALT="Billede 1"
onclick="return NewWindow(this.href,'link','566','400','no');">

- and the - NewWindow - function could return false to cancel the
navigation and return true to allow the fall-back of navigating within
the current window when the call to window.open is not possible.
However, If you start providing fall-back it becomes worth while to
check the object returned from the call to window.open to ensure that it
has not been influenced by browser settings, content
inserting/re-writing proxies or external pop-up blocking software.
Unfortunately a full battery of tests to cover all of those
possibilities has not yet been written (and is widely believed to be
impossible). Those tests might include:-

if((!win)||(win.closed){
// window has already been squashed by browser settings
// or an external pop-up blocker.
}else{
// window may yet be squashed by external pop-up blocker.
}

if(win == window){
// Proximatron default pop-up blocking filter or similar
// content inserting/re-writing proxy.
}

//and so on.

<snip More good advice.>I also recommend against depending on new windows.


Absolutely.

Richard.
Jul 20 '05 #6
On Sat, 23 Aug 2003 02:35:51 +0100, "Richard Cornford"
<Ri*****@litotes.demon.co.uk> wrote:
except that Pocket IE apparently
lacks a global 'window' property so even that test will error ("window
is null or not an object!, though Pocket IE does not report errors by
default).


That's not quite right with PIE, window object exists, but going
anywhere near window.open results in an untrappable error.

The only "browser" I know of that doesn't follow the window/global
object convention is Corel SVG Viewer 1.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #7
"Jim Ley" <ji*@jibbering.com> wrote in message
news:3f***************@news.cis.dfn.de...
except that Pocket IE apparently lacks a global
'window' property so even that test will error ("window
is null or not an object!, though Pocket IE does not report
errors by default).
That's not quite right with PIE, window object exists, but going
anywhere near window.open results in an untrappable error.


OK. I haven't had a chance to have a real poke around Pocket IE yet. I
would love the chance to run my DOM scanning script over it but I doubt
that it has the onboard memory to support such a big script (Palm OS
browsers always run out of memory with it :( ).
The only "browser" I know of that doesn't follow the
window/global object convention is Corel SVG Viewer 1.


I knew someone had mentioned an environment without a reference to the
global object. I must have mentally put that together with your warnings
about window.open on Pocket IE. Thanks for sorting it out.

Richard.
Jul 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Yvan J. Gagnon | last post by:
I am currenly developing a web site using Macromedia fireworks, and am trying to figure out a way (through hand-coding) of attaching a javascript function (onClick="doit=false") to each of the...
10
by: Simon Wigzell | last post by:
Is there any way to create and open a window in javascript so that links in other websites won't "steal" it? I've written a web page with a form for people to enter headlines and URLs from...
2
by: dennishancy | last post by:
On my web site, I have a "Links" link. Rather than create a separate HTML file listing all the links, I'd like to create a popup menu (not sure if that's the official name or not). So, when I...
23
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
3
by: Jim Davis | last post by:
The scenario: 1) Generate a popup window via script. 2) Populate it (again via script) with content that features local (hash) links. In IE 6.x this works - the links work as they should,...
9
by: john | last post by:
In Paradox I was able to create popup menu's in which some of the items had popup menu's themselves. I've looked for threads on popup menu's and access but I can't find how to make a simple popup...
7
by: fredo | last post by:
I've studied Eric Meyer's pure css popups, version two: http://meyerweb.com/eric/css/edge/popups/demo2.html which pops up an image when I roll over a text link. Now I want to pop up a large...
3
by: cmo | last post by:
Well I hope I this isn't too nebulous of a problem. The problem I currently have is this: I have a button in a form that opens up a javascript/css poup that has an input field and two ahref links...
11
by: V S Rawat | last post by:
using Javascript, I am opening a web-based url in a popup window. MyWin1=Window.Open(url, "mywindow") There is a form (form1) in the url in that popup window, I need to submit that form. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.