• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

place div element in lower left corner of browser using jQuery

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Michael Brown
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic