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

moving one box over another

I would like to design a web page as follows:

There is a box (box A) with some things in it that the user can click
on. When an item is clicked, another box (box B) moves in from the
right side of box A. I don't want box B to exist outside of A, simply
start on the right side and then cover up all of B.

I am going to be targetting Firefox 2.x only, well if it works in IE7
and Safari 3, great, but the kiosk is going to be running Firefox, so
I would like to use the latest techniques. I get the impression that
what I want to do might be acheivable with CSS2 and limited
JavaScript, I could be wrong.

If this is a JavaScript animation, I am sure I could figure out the
details, I would like the general idea of how best to do it, though.
Do you simply loop through moving it one pixel at a time with a
sleep? Also, how to I keep box B contained within box A?

Cartoper

Aug 31 '07 #1
3 3272
On 2007-08-31, Cartoper <ca******@gmail.comwrote:
I would like to design a web page as follows:

There is a box (box A) with some things in it that the user can click
on. When an item is clicked, another box (box B) moves in from the
right side of box A. I don't want box B to exist outside of A, simply
start on the right side and then cover up all of B.

I am going to be targetting Firefox 2.x only, well if it works in IE7
and Safari 3, great, but the kiosk is going to be running Firefox, so
I would like to use the latest techniques.

I get the impression that
what I want to do might be acheivable with CSS2 and limited
JavaScript, I could be wrong.
Not wrong.
If this is a JavaScript animation, I am sure I could figure out the
details, I would like the general idea of how best to do it, though.
Do you simply loop through moving it one pixel at a time with a
sleep?
There's no sleep in JavaScript. Instead you use setInterval, which
causes a function to be called periodically. In the function you update
the position of the div you're moving (by setting style.left for
example).

You can achieve the same result with setTimeout and keep resetting it,
but setInterval is much better.

Something like this:

var timer;

function tick()
{
// Change boxB's style.left to what it was before -5px until it gets
// to zero. When it has reached 0, clear the timer with a call to
// clearInterval(timer)
}

timer = setInterval(tick, 32);
Also, how to I keep box B contained within box A?
You can give A overflow: hidden, which I think is what you must mean
here since you want box B to behave like a sliding door that appears
from nowhere?
Aug 31 '07 #2
On Aug 31, 3:19 am, Ben C <spams...@spam.eggswrote:
Also, how to I keep box B contained within box A?

You can give A overflow: hidden, which I think is what you must mean
here since you want box B to behave like a sliding door that appears
from nowhere?
Can you give me a little more detail on this? Would I define both
div's next to each other or would I define B in side of A? I do plan
to turn this into an ajax page where the user can keep doing this to
drill down into a menuing system. (Think iPod menu system, fore that
is the insperation<grin>)

Cartoper

Aug 31 '07 #3
On 2007-08-31, Cartoper <ca******@gmail.comwrote:
On Aug 31, 3:19 am, Ben C <spams...@spam.eggswrote:
Also, how to I keep box B contained within box A?

You can give A overflow: hidden, which I think is what you must mean
here since you want box B to behave like a sliding door that appears
from nowhere?

Can you give me a little more detail on this? Would I define both
div's next to each other or would I define B in side of A?
I was assuming B was inside A. But you can do it how you like.
I do plan to turn this into an ajax page where the user can keep doing
this to drill down into a menuing system. (Think iPod menu system,
fore that is the insperation<grin>)
Sounds good.
Aug 31 '07 #4

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

Similar topics

6
by: Hemant Shah | last post by:
Folks, I need to move HOME directory of an instance to another directory. What is the best way of doing it? Is changing password file enough? or dies DB2 store this info in it's own config? ...
2
by: Wayne Aprato | last post by:
I've read most, if not all, of the posts on moving average and still can't find a simple solution to my problem (if a simple solution exists!) I have a table with 2 fields: Hours and Injuries. I...
3
by: Just Me | last post by:
If I move the mouse cursor over a control and stop moving I get a MouseHover event. If I then move the cursor while staying within the control and then stop moving I do not get another...
0
by: Jeff Waskiewicz | last post by:
Here is what I am trying to accomplish. I have an MDI application on the left side of the client area I have a borderless form that holds a treeveiw for navigation. When an item is selected from...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
In a database search application (vb2005), the user wants to be able to scroll through records using the mousewheel. The data display form contains textboxes for the main data and a datagridview...
7
by: bwmiller16 | last post by:
Folks - DB2 V9.2 on SUSE 9 Is there a way other than moving the entire /sqllib/db2dump/ (Default database path (DFTDBPATH) = /home/db2inst1 to move just STMMLOG out of there to another...
4
by: =?Utf-8?B?R1Q=?= | last post by:
I have a Form which has a great number of events. I thought I would organize the project by moving some of the code into multiple '.cs' files (since the Form.cs was getting huge). When I move them,...
0
by: xpnet | last post by:
Hi, I am using Mutliview control, and want to move a user control from one view to another view based on user selection. I can do this by placing a "Placeholder" control in each views. Based on...
15
by: mcjason | last post by:
I saw something interesting about a grid pair puzzle problem that it looks like a machine when you find each that work out the way it does and say with all the others that work out the way they...
5
by: adarshyam | last post by:
Hi friends, I have an interesting problem in vb.net. And I am struggling to get a solution for this..m trying for the past 3days.. It’s to calculate moving average for the inputs given by the...
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
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...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.