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

Can one use javascript to find if one <div> element is covering/over another

2
At the moment I making an ajax based file manager system. Im approched by a tricky problem. As in windows explorer etc I want users to be able to select any free space, click down, and drag a semi-transparent box around that will automaticly select any file/folder elements it covers over.

In a more general sense, take this tutorial page with the three movable objects. I can lift Item 1 and place it over Item 2. But can I use javascript now, so that it automaticly triggers a function because Item 2 is covering Item 1.

So basiccaly Im wondering is there any way to determine if one <div> is covering another?? Cheers for any ideas!
Nov 23 '08 #1
3 2772
acoder
16,027 Expert Mod 8TB
If all you want is the divs covered by the semi-transparent box, why not check the positions of the divs on mouse up?
Nov 24 '08 #2
turgon
2
Well I want the elements to change color as they are highlighted. And doing a co-ordinates comparision of every element with the selecting box every time the mouse moves would be too memory intensive.
Nov 24 '08 #3
acoder
16,027 Expert Mod 8TB
Is the instant highlighting a must? If not, you can use transparency and a dimming effect to make it obvious which are selected. What about onmouseover for the divs and you can use bubbling/capturing (see article) for multiple divs on top of each other.
Nov 24 '08 #4

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

Similar topics

23
by: Mikko Ohtamaa | last post by:
From XML specification: The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. (This means that <foo></foo> is equal to...
7
by: Herbman | last post by:
Hi, I'm trying to position a <tr> ("row") element with CSS. The table itself is positioned with <div> tags. The problem is when I use <div> tags to position the rows within the table nothing...
27
by: skeeterbug | last post by:
please see http://www.geocities.com/operationsengineer1/test.htm for an idea of how i want my logo header div to be layed out. when i went to resize "Test" to 2em (from 1em), this is what...
14
by: Charlie T | last post by:
Hello, is there any way to get this to work? myID.innerHTML = "Hello" <DIV id="myID"></DIV> <DIV id="myID"></DIV>
6
by: Gregory | last post by:
Hi all. A quick question. In normal XHTML pages, you can put text inside of a <div> element, and all goes well. Essentially, im trying to port over some XHTML stuff into asp.net, but add in...
11
by: News | last post by:
Here is the form and div snippet <form <form name="myForm"> <div id="myDiv"> { background-color: #9900FF; } </div> </form>
28
by: Kent Feiler | last post by:
1. Here's some html from a W3C recommendations page. <P>aaaaaaaaa<DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</DIV> 2.Although I didn't think it would make any difference, I tried it with the...
10
by: Summercoolness | last post by:
so i am starting to use more of <br /and <div style="clear: both" / which is the XHTML style... now, won't those actually confuse the old browsers? for example, will the old browser treat the...
0
by: msch-prv | last post by:
How to maintain the display state of a <divelement? Is there a simple way to maintain the display state of a <div> element? On my page, a div block can be hidden/shown by js function...
2
by: paul | last post by:
I have a JS function to change the width of a <divthat works great in Firefox, but not at all in IE7. In IE an error message occurs: Line: 92 Char: 5 Error: Invalid Argument Code: 0 Firefox...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.