Closed Thread Icon

Topic awaiting preservation: usage of onmouseoverevent (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=26247" title="Pages that link to Topic awaiting preservation: usage of onmouseoverevent (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: usage of onmouseoverevent <span class="small">(Page 1 of 1)</span>\

 
praveen
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Jul 2005

posted posted 07-15-2005 08:53

i Need some help in Java Script,

am using the following code :
<script type="text/javascript">
var newwindow; function poptastic(url)
{
newwindow=window.open(url,'name','height=300,width=400,left=100, top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');

if (window.focus) {newwindow.focus()}

</script>

In HTML,

<a href="environment.htm" onmouseover="poptastic('environment.htm');return true;">World Environment
Day, June 5<sup>th</sup>,2005</a>


Am using onmouseover event, so that when my mouse in on the link, popup is opened....and when my mouse is out of the link, the new window should b closed....

but according to the above code, the new window is opened but have to close it manually....

Is there any other way to close the popup when my mouse is out of the link

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 07-15-2005 10:19

Hello and welcome in the Asylum,

Simply do :

code:
<a href="environment.htm" onmouseover="poptastic('environment.htm');" onmouseout="newwindow.close();">World Environment
Day, June 5<sup>th</sup>,2005</a>

However I hope you realize how annoying such behavior can be. And in fact it can drive away many users ... at least it would for me. Are you sure you can't replace that popup window by a simple show/hide DIV that would behave sort of like a tooltip ? And for that, depending on the layout, you could even get rid of the JavaScript.

See, the css:

code:
a#environment div
{
    display:none;
}
a#environment:hover div
{
    display:inline;
}

and the markup :

code:
<a href="environment.htm" id="environment">World Environment
Day, June 5<sup>th</sup>,2005
    <div>a summary/abstract of the content of you environment.htm page</div>
</a>

[edit] Doh!!!! I just checked in IE6 and the CSS way doesn't work. What a crap! That's unbelievable. Well it's easy to get it working but that's insane. [/edit]

However, hope that helps,

Blaise
Paranoid (IV) Inmate

From: London
Insane since: Jun 2003

posted posted 07-15-2005 11:23

maddness! Nice brain storm there though poi, I like it

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 07-15-2005 11:31


to fix it, one can use a simple script like the one to get the sub navigation of my own site working.

« BackwardsOnwards »

Show Forum Drop Down Menu