473,382 Members | 1,526 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,382 software developers and data experts.

onblur() not working with mozilla

5
Hi,

I am facing an issue with the onblur() event. The requirement is when i click a small icon in my html page a small rectangular overlay containing some text message should appear and it should disappear when I click any where else on the page.

I have implemented the situation using java script. To bring the overaly using java script, the display property of a div is made visible and to make the same overlay hidden i have used the onblur() event.

<div id="linker3" class="linker" onBlur="showBlur('linker3')" > </div>
The id linker3 is the name of the popup layer as i use 5 similar pop ups.

class linker defines the properties of the pop up.
Expand|Select|Wrap|Line Numbers
  1. .linker{
  2.     background: url(Images/box.gif) no-repeat;
  3.     width: 128px;
  4.     height: 46px;
  5.     margin: 30px 0 0 0;
  6.     position: absolute;
  7.     z-index: 80;
  8.     display: none;
  9. }
  10.  
function showBlur(id){
var box=document.getElementById(id);
box.style.display='none';
}



This is working fine for IE6 but not for mozilla. Could you please help
Nov 6 '08 #1
10 7080
Did you check what error appears in the firefox error console?
Nov 6 '08 #2
tijo
5
No error is shown in the error console. Is the issue due to the fact that mozilla doesn;t recognize onblur() event.
Nov 6 '08 #3
Firfox do recognize onblur function. Though, make sure that if the function is being called or not, something like inserting alert() inside the function.
Nov 6 '08 #4
tijo
5
Hi,

When i repalced the onblur event with ondblclick(), it worked fine for both IE and Mozilla, ie the overlay div was made dispaly none uisng the same script.

<div id="linker2" class="linker" ondblclick="showBlur('linker2')" > </div>

When If repalced it with onblur(), IE alone recognizes

Do you know any other way to meet this requirement
Nov 6 '08 #5
Another way may be using the javascript timer functions.After some time interval you can hide the popup.
Nov 6 '08 #6
tijo
5
No That cannot be done in this application. This pop up should be closed only when a click is made some where else on the page. Can you suggest a method.
Nov 6 '08 #7
what about onmouseout() function?
Nov 6 '08 #8
tijo
5
Sorry,

The client requires a click outside that div to close the popup
Nov 6 '08 #9
then use the onclick event of the body element. There seems a real problem with onblur event in the 'div' for the firefox.
Or there is a tricky way to force input element behave like div. The onblur method works fine in input elements.
Nov 6 '08 #10
acoder
16,027 Expert Mod 8TB
That's correct. Firefox doesn't support onblur for divs. See notes on this ref. page. This is correct behaviour - see supported events for div and span.

The workaround is to use onclick on the document and check that the div is not the target.
Nov 6 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Wendy S | last post by:
I'm trying to make sure that a form gets submitted when the person leaves this field. <input type="text" name="prospectNameOrId" size="50" value="" onblur="setUserAction('Add Prospect');...
2
by: D. Alvarado | last post by:
Hi, I'm having some trouble with the "onBlur" event in the BODY tag. Ideally, what I want to happen is that when someone leaves window A, window A executes a command. I had put <body...
6
by: rob | last post by:
Hi I'm trying to create a "roll-up" effect when a window loses focus and then "roll-down" when it regains focus. This statement works properly with every browser I can get my hands on EXCEPT...
2
by: Suresh | last post by:
Can anybody tell me that whether Mozilla supports onBlur event? I tried onBlur event with IE5 and also with Mozilla. But Mozilla is not supporting. Please give me a solution. Regards Suresh.
1
by: anand basha | last post by:
Hi ! What is the replacement for onBlur in Mozilla <body STYLE='background-color:buttonface;' leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 onBlur="window.focus()"> *** Sent via...
1
by: haisenthilk | last post by:
Hi I have a text box. I have to validate it only for numbers. There is another text box which depends on the value of the previous. so i should do the validation in onBlur().. If...
3
by: rjones326 | last post by:
Hi, I'm stupendously mystified by this strange activity. I cannot for the life of me figure out why this will not work in mozilla. I've spent hours mucking around with it. The php file is...
10
by: John Kotuby | last post by:
Hello all... I am working on an ASP.NET 2.0 application with VS2005 and VB. I have chosen to use popup windows in some cases because it makes the user experience better (according to all the users...
3
by: empiresolutions | last post by:
i am using the following AJAX request method. Most of you probably use this script allready as it seems to be everywhere online. I use it often with out issue... until now. What I'm finding is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.