This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes place div element in lower left corner of browser using jQuery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "place div element in lower left corner of browser using jQuery" Watch "place div element in lower left corner of browser using jQuery" New topic
Author

place div element in lower left corner of browser using jQuery

Michael Brown
Greenhorn

Joined: May 05, 2008
Posts: 27
Hello!

Can somebody help me with this problem:

I started learning jQuery, and cannot figure out how to position some div in lower left corner of my browser...?


This div's ID is , for example "myDiv", and is not visible.

I want to position it, and then show it using .show() function

Thanks!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

No need to use jQuery. Positioning can be accomplished via CSS. Check out the fixed value of the position property. (Note: not all browsers yet support this).

The only time you'd need jQuery assist is if you want to dynamically position the element in browsers that do not support fixed.

Or are you trying to move it into this position as part of an animation?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Michael Brown
Greenhorn

Joined: May 05, 2008
Posts: 27
Bear Bibeault wrote:

Or are you trying to move it into this position as part of an animation?


Yes, this is exactly what I would like to do...

One option is to create this div when page loads ( and set it's display: none) and position it later it in the lower left corner and show it...

Or to create it dynamically and then position it it in the lower left corner and show it...

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

That's contradictory.

Do you want it animated or not? Animation will involve script (jQuery), while non-animated can be done with simple CSS.

For animation, you can use jQuery to compute the final position of the element, and use the .animate() method. Otherwise, you can just position it with CSS.
 
Consider Paul's rocket mass heater.
 
subject: place div element in lower left corner of browser using jQuery