AllExperts > Experts 
Search      

Javascript

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Javascript Answers
Question Library

Ask a question about Javascript
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Anthony Levensalor
Experience
I have been programming in Java and Javascript since 1998. I run a web development company that specializes in Ajax front ends with PHP/MySQL back ends. I am a Sun Certified Java 2 Developer, and have done nothing but web applications for the last two years in my business

Past/Present clients
Monster.com, Compuware Corporation, Flextronics International, Pragmatech Software, Open Travel Software, The Loss Mitigation Institute, Raw Story Media, Page One News Media.

 
   

You are here:  Experts > Computing/Technology > Focus on JavaScript > Javascript > Adjut div position depending on othe div

Topic: Javascript



Expert: Anthony Levensalor
Date: 9/26/2007
Subject: Adjut div position depending on othe div

Question
I have two divs, on captures info and the displays save etc.
Now the prob is the display of info div is not constant. It will be displayed at times and mot other.
The prob is to display the save div relatively to the info div.
i.e. if info div is displayed the save div should be displayed next to it, if info div is not displayed then the saveDiv should be displayed next to the text before the info div.
Please advise
- Anu

Answer
You can try playing with the style attributes of the div in question, sounds like float:left; or some such might suit your needs. Since I'm no expert in HTML formatting, best I can do is give you some code I would try.

if info div is displayed:
infodiv.setAttribute("style", "float:left;");
if infodiv is !displayed:
savediv.setAttribute("style", "float:right");

By dynamically changing the styles, you can play around with the attributes until you can make it fit. For the actual formatting, try an HTML or CSS expert, those guys are the bomb.

All the best,
~A!

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.