473,399 Members | 3,656 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,399 software developers and data experts.

Position and top of a div after move

DL
Hi,

My research on this NG hasn't produced a satisfactory answer. Here's
what I want to do:
move two div (s) (each has an image tag within) to another location on
the same page.
// no problem with that
// prior to move, position = fixed;
// at each move, I capture the new top value

Now, the question is, how do I display the two div (s) with the new
position and top (the top part is working)?
// currently, the second div, that is an image within it lays below
the first one but the move action places the second div to the right
of the first.

In other words, with the new page, I don't know what value to use for
the position Attribute for each of the two div (s). I've tried
different combo for the "Absolute" | "Fixed" value ...

TIA.
Jun 27 '08 #1
5 4258
DL
On Apr 27, 11:17*pm, DL <tatata9...@gmail.comwrote:
Hi,

My research on this NG hasn't produced a satisfactory answer. * Here's
what I want to do:
move two div (s) (each has an image tag within) to another location on
the same page.
// no problem with that
// prior to move, position = fixed;
// at each move, I capture the new top value

Now, the question is, how do I display the two div (s) with the new
position and top *(the top part is working)?
// currently, the second div, that is an image within it lays below
the first one but the move action places the second div to the right
of the first.

In other words, with the new page, I don't know what value to use for
the position Attribute for each of the two div (s). * I've tried
different combo for the "Absolute" | "Fixed" value ...

TIA.
Is the problem too difficult to be resolved or is my problem statement
not clear enough (I thought if you'v done something similar it
wouldn't be too difficult to understand what is presented here)?

Thanks.

Jun 27 '08 #2
On 2008-04-29, DL <ta********@gmail.comwrote:
On Apr 27, 11:17*pm, DL <tatata9...@gmail.comwrote:
>Hi,

My research on this NG hasn't produced a satisfactory answer. * Here's
what I want to do:
move two div (s) (each has an image tag within) to another location on
the same page.
// no problem with that
// prior to move, position = fixed;
// at each move, I capture the new top value

Now, the question is, how do I display the two div (s) with the new
position and top *(the top part is working)?
// currently, the second div, that is an image within it lays below
the first one but the move action places the second div to the right
of the first.

In other words, with the new page, I don't know what value to use for
the position Attribute for each of the two div (s). * I've tried
different combo for the "Absolute" | "Fixed" value ...

TIA.

Is the problem too difficult to be resolved or is my problem statement
not clear enough
I think the latter!
(I thought if you've done something similar it wouldn't be too
difficult to understand what is presented here)?
I really couldn't understand it at all. How do you capture the new top
value? When you say new position, do you mean new location on the screen
or new value of the position property? Where do you want the image to
move to? Where is it moving to?
Jun 27 '08 #3
DL <ta********@gmail.comwrites:
On Apr 27, 11:17Â*pm, DL <tatata9...@gmail.comwrote:
>>
My research on this NG hasn't produced a satisfactory answer. Â* Here's
what I want to do:
move two div (s) (each has an image tag within) to another location on
the same page.
// no problem with that
// prior to move, position = fixed;
// at each move, I capture the new top value
I don't follow this. Moving is not a common CSS operation. When do
you move things? My first thought is you are using JS and thus your
post is off topic, but...
>Now, the question is, how do I display the two div (s) with the new
position and top Â*(the top part is working)?
// currently, the second div, that is an image within it lays below
the first one but the move action places the second div to the right
of the first.

In other words, with the new page, I don't know what value to use for
the position Attribute for each of the two div (s). Â* I've tried
different combo for the "Absolute" | "Fixed" value ...
a URL will more the double your chance of someone helping. A "best
attempt" live example is worth 1000 words.

--
Ben.
Jun 27 '08 #4
DL wrote:
Hi,

My research on this NG hasn't produced a satisfactory answer. Here's
what I want to do:
move two div (s) (each has an image tag within) to another location on
the same page.
// no problem with that
// prior to move, position = fixed;
// at each move, I capture the new top value
It's unknown and indecipherable what you are doing.

You need to use javascript to read element attributes/properties. How
you do that depends on just what you want to read and whether it is in
the document flow or outside of it.

My guess is that googling "javascript find position" might give you a
start.

If you want the image to lay on top of the existing page, you'll want
position: absolute, and you'll want to either set a zIndex or write the
html for those late in the page html so it's inherent zIndex is higher.

Jeff
>
Now, the question is, how do I display the two div (s) with the new
position and top (the top part is working)?
// currently, the second div, that is an image within it lays below
the first one but the move action places the second div to the right
of the first.

In other words, with the new page, I don't know what value to use for
the position Attribute for each of the two div (s). I've tried
different combo for the "Absolute" | "Fixed" value ...

TIA.

Jun 27 '08 #5
DL
On Apr 29, 11:48*am, Jeff <jeff@spam_me_not.comwrote:
>...
It's unknown and indecipherable what you are doing.

You need to use javascript to read element attributes/properties. How
you do that depends on just what you want to read and whether it is in
the document flow or outside of it.

* *My guess is that googling "javascript find position" might give youa
start.

* *If you want the image to lay on top of the existing page, you'll want
position: absolute, and you'll want to either set a zIndex or write the
html for those late in the page html so it's inherent zIndex is higher.

* *Jeff
Thank you all. Let me clarify what I intend to do here.

The page has two components of simple inline CSS and HTML code and
content.

Objective: find the values of the two Attributes of {postion} and
{top}, in essence the x/y coordinates of the DIV of ID "ElementOne"
after its move to another spot of the same page.
// don't worry about how to move it, it's done

The key aspects of "things" are as follows:
// CSS part
<style type="text/css">
div#ElementOne {
position: absolute; /* try fixed as well*/
top: 300px;
z-index: 200;
}
</style>

<!-- HTML part -->
...
<div id="ElementOne">This is Element One</div>
...

Thanks.
Jun 27 '08 #6

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

Similar topics

7
by: Erik Sandblom | last post by:
Hello I'm trying to make some tooltips which are position:fixed. It works fine in Opera and Safari/Konqueror, but in Firefox and Camino (ie Mozilla), it takes a few seconds for each tooltip to...
2
by: sara | last post by:
How to change the position of webservercontrol at runtime
5
by: Jay | last post by:
I am trying to code an application that will move a image around the screen depending on what arrow keys the user presses. If the user presses the up key, the graphic will move up a few positions,...
2
by: mmdst23 | last post by:
I'm working on a video player app, and I want to implement a trackbar that behaves like the one in Media Player, that is the cursor position moves to where the user clicked instead of moving in...
8
by: Edward | last post by:
I used to do this all the time in HTML-table layouting. How do I do this in CSS? -------------------------------------------------- <table width="400px"> <tr> <td bgcolor="beige">one line of...
2
by: pierre | last post by:
Hello, I have a page with 2 divs : <div id="box_out" style="position: absolute; width: 600px; height: 500px; overflow: scroll; border: 1px solid #f00;"> <div id="box_in" style="position:...
19
by: wmanzo | last post by:
I have a really professional conspiracy movie site and I use tons of layers and an external scroll bar assembly. I would like to put the various sections into MS Iframes and in order to clean up...
0
by: crisscross27 | last post by:
Hi, I found a page called "myflashfetish" where you chan choose mp3 players for my space, well the problem is this, I wanted to place 2 or more players in myspace in a particular place, I read...
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: 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
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.