File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 61434
    
  67

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: 61434
    
  67

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.
 
Don't get me started about those stupid light bulbs.
 
subject: place div element in lower left corner of browser using jQuery