Solved

How to move an object from left to center?

Posted on 2007-11-30
7
149 Views
Last Modified: 2013-11-05
I know almost nothing about javascript, so please bear with me... I have an object (picture) that I want to have move from the left side of the web page to the center.  I can't imagine this hasn't been done before; is there a "canned" javascript that would do this for me? (hopefully with instructions, like a tutorial)?

I appreciate the help.
0
Comment
Question by:rmmarsh
  • 3
  • 2
  • 2
7 Comments
 
LVL 7

Expert Comment

by:bdichiara
ID: 20384405
Are you wanting it to animate, or simply move from the left to the center in 1 quick step?
0
 

Author Comment

by:rmmarsh
ID: 20384423
kind of like "amble" across the page (not slow, but now fast either)... what I have is a jpg that I want to have move from left to the center of the page where it is now... just wanted to spiffy up the site a bit... :D
0
 
LVL 7

Accepted Solution

by:
bdichiara earned 250 total points
ID: 20385636
I would check out some of the pre-built packages like Scriptaculous and Mootools. With the help of some javascript that detects the width of the browser window, you should be able to find the center of the screen and execute a MOVE or SLIDE with one of those scripts. It may even have a built-in center option. Check out the documentation.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:rmmarsh
ID: 20385669
I have looked at Scriptaculous, and it looks like it would do what I want... however, getting it integrated with D.H.E. (Dynamic HTML Editor) is where the problem is.  I don't know where to start, where to put what, and that obviously is the problem.  I'm reading a Javascript textbook now to get up to speed, but would like to get this done before the New Year! :D

Do you know D.H.E.?
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 20388071
I am not familiar with DHE, but if it is just another Javascript package, you can include both in your <head> section just by including the right <script> tags. Libraries are usually built well enough so that conflicts can be avoided.
0
 

Author Comment

by:rmmarsh
ID: 20388085
No, it's a HTML editor (pretty cool, at that!)... so everything goes in the HEAD section?
0
 
LVL 36

Assisted Solution

by:Zyloch
Zyloch earned 250 total points
ID: 20388089
Yes, you almost always want to include external Javascript in the <head> section. I am more familiar with jQuery than Scriptaculous, but you should be able to find demos on their pages that show you how to use it. All of the popular Javascript libraries today come with very nice animations.

Please let us know if you encounter any problems, and we'll try to help you further.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question