468,556 Members | 2,135 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,556 developers. It's quick & easy.

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 4024
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Erik Sandblom | last post: by
2 posts views Thread by sara | last post: by
5 posts views Thread by Jay | last post: by
2 posts views Thread by pierre | last post: by
19 posts views Thread by wmanzo | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.