473,698 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5855
"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="JavaS cript">
<!-- Begin
function NewWindow(mypag e, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops =
'height='+h+',w idth='+w+',top= '+wint+',left=' +winl+',scrollb ars='+scroll+', resizable=no'
win = window.open(myp age, myname, winprops)
if (parseInt(navig ator.appVersion ) >= 4) { win.window.focu s(); }
}
// End -->
</script>

and on the hotspot:

<area SHAPE=RECT COORDS="216,154 ,414,296" HREF="1.htm"
ALT="Billede 1"
onclick="NewWin dow(this.href,' link','566','40 0','no');return
false;" OnMouseOut="win dow.status=''; return true"
onMouseOver="wi ndow.status=''; return true"
onfocus="this.b lur()">

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******** ***********@new s-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="JavaS cript">
<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(mypag e, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2; winprops =
'height='+h+',w idth='+w+',top= '+wint+',left=' +winl+',scrollb ars='+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.availWid th and screen.availHei ght. 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(myp age, myname, winprops)
If you don't use the "win" variable outside the function, make it a
local variable.
if (parseInt(navig ator.appVersion ) >= 4) { win.window.focu s(); }
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.new s.tele.dk>, Knud Gert
Ellentoft <kn******@mail. tele.dk> writes:
In <head>:
<script LANGUAGE="JavaS cript">
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(mypag e, 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= '+winl+',scroll bars='+scroll+ ',resizable=no'win = window.open(myp age, myname, winprops)
if (parseInt(navig ator.appVersion ) >= 4) { win.window.focu s(); }
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(myp age, 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','56 6','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*****@litote s.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.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #7
"Jim Ley" <ji*@jibbering. com> wrote in message
news:3f******** *******@news.ci s.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
9934
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 links in my fireworks-generated dhtml popup menus. Does anyone here know where I would add this javascript fucntion in the code so that it would be recognized? And do I do it in the html, or in the JS file? The javascript function I need to add is...
10
2389
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 newspapers. They will want my window to stay there as they surf through various online newspapers. We don't want their popup links to take over my form window! This is a real problem - it renders my web page useless and wastes peoples time.
2
1965
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 click on "Links", I'd like to have a small popup menu appear with a list of all my links, from which the user can select one. Is there a way to do this within Javascript? Dennis Hancy
23
6402
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 align="center">
3
2121
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, moving the document to that document position. However in FireFox 1.x the links load the main page (the opener) in to the popup. Both browsers populate the location.href of the popup with the main page's href... but this only adversly affects...
9
7875
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 menu. The popup menu I want to make should appear when I rightclick a button on my form. A user's choice should do some action. Can someone point me in the right direction? thanks, john
7
27497
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 image when I roll over a thumbnail. I've tried some things, but can't make it work. See here (Warning: adult matter):
3
2777
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 for ok and cancel, both of which call the popup's toggle() method (same thing that is called from the button). The form that this button is in has fields that can be added or removed by the user. Everything works great in firefox and netscape,...
11
5308
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. How do I submit that form1 from the javascript from my current window? Thanks.
0
8608
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7732
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.