473,382 Members | 1,635 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.

Safari mousedown event

I have a big <table> and I have added an onmousedown handler.
When I get back the event in IE and Firefox, the individual <td>
element appears in window.event.srcElement (IE) and in
event.target (Firefox). However in Safari the target is just the
<table>, not the <td>.

I need to get back the <td> associated with the event, and I would
not like to put an onmousedown handler on each table cell because
there are a lot of them. Does anybody know how I can get the event
and figure out which table cell was clicked? Thanks.

Dec 7 '05 #1
2 2231
P.S. The exact same thing happens with onmouseclick as
onmousedown on Safari: the event's target is the <table>
rather than the <td>.

Dec 7 '05 #2
Sorry to answer my own post (again) but I've found the
fix, at least for the first of my project's Safari problems.
In my table, if a cell is completely empty, the event was coming back
with its target set to the <table> in Safari. If I add an &nbsp;
to the empty table cell, now the mouse events come back
pointing to the <td> element. This is a small difference between
Safari and the other browsers, where the event target is the <td>
element even if the cells are empty.

Dec 7 '05 #3

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

Similar topics

3
by: Deborah V. Gardner | last post by:
I have a list box and would like to point to an item and have a textbox popup referencing a column in the list box. On the list box's MouseDown event I have the following Dim strFullText ...
2
by: JJ | last post by:
Hi All, I need to create a MouseDown event for a picture box . Am I doing the following right? pictureBox.MouseDown += new System.WinForms.MouseEventHandler(pictureBox_MouseDown) Then
1
by: GregM | last post by:
I have a read only datagrid that is designed to coordinate itself with textboxes. When the user clicks on a row in the datagrid, detailed data for that row is displayed for editing in the...
7
by: Scott Mackay | last post by:
Hi, I'm using visual studio dotnet 2002 programming in vb can anyone tell me how I can handle the mousedown event for pictureboxes I create dynamically at runtime? I've tried setting the...
4
by: rsmith | last post by:
How can I capture the MouseDown event on a Label ? I entered thr following code and got a " cannot handle Event 'MouseDown' because they do not have the same signature." Private Sub...
1
by: Merlin | last post by:
I have created a UserControl which has a label; what I wish to do is place this UserControl on a form and then trap the Mouse Down event, whenever someone clicks my control. My problem is that the...
2
by: Rob | last post by:
How can I fix the following warning warning BC40004: sub 'MouseDown' conflicts with event 'MouseDown' in the base class 'Control' and so should be declared 'Shadows'. This warning appears...
1
by: Alan | last post by:
i have a form with a label on it Private Sub Label1_mousedown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown ' do stuff End Sub ...
5
by: Peter Michaux | last post by:
Hi, I just did a bunch of testing and was surprised with the results. If anyone doesn't know this stuff here is what I found about event.clientX. The event.clientX property in Safari is in...
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: 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?
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...

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.