Results 1 to 7 of 7

Thread: positioning at the bottom of the window

Hybrid View

  1. #1
    Join Date
    Jan 2010

    positioning at the bottom of the window


    im wondering what the best way of positioning something at the bottom of the window is, by that i mean it should allways be on the bottom even if i scroll, just like its a menu at the bottom following u everywhere. Can this be done by just css or do i need to use jquery scroll events to position it allways at the bottom?

    what is the best way to do this?

  2. #2
    Join Date
    Oct 2005
    Cambridgeshire, UK
    If it's following the user as they scroll i'm afraid using Javascript would be the only way (that I can think of anyway)
    - Freelancing Services
    - Web Development Snippets, Hints and Tips

  3. #3
    Join Date
    Jan 2010
    i see, i did that with a div box but not every browser does this as good as chrome :/ on firefox it keeps blinking when i scroll. =/

    i do it like this:

        // makes the 160x600 rightside ad to follow the screen when scrolled
        $(window).scroll(function() {
            var scrollTopHeight = $(window).scrollTop();
            var setHeight = scrollTopHeight-148;
            if (scrollTopHeight >= 151)  {
                $("#c160wrapper_adFixed").css({'top' : setHeight+'px'});
            else {
                $("#c160wrapper_adFixed").css({'top' : '0'});
    can this be done in a better way? (im sure it can but how ^^)

    i wonder how facebook does it.

  4. #4
    Join Date
    Dec 2009
    try using css using fixed positioning, such as

    #div {position: fixed;
            bottom: 0px;
            left: 0px;

  5. #5
    Join Date
    Jan 2010
    Quote Originally Posted by skullsnest View Post
    try using css using fixed positioning, such as

    #div {position: fixed;
            bottom: 0px;
            left: 0px;
    but it doesnt update itself when scrolling, u need to use js

  6. #6
    Join Date
    Mar 2007
    Try this

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <div style="position: relative; z-index: 1; width: 200px; margin: auto;">
    	<div style="position: fixed; bottom: 0; background-color: red;">
        	Bottom of the page
    <div style="width: 400px; border: 1px solid black; margin: auto;">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eget erat elit, id tristique erat. Integer sodales elit eu erat cursus eu convallis est aliquam. Fusce a hendrerit ligula. Nulla vitae sapien neque, in semper nunc. Proin ultricies arcu sit amet lorem interdum in pellentesque lorem consequat. Integer mattis porttitor ipsum et tristique. Maecenas vitae lorem eros. Curabitur ornare nisl non tellus ultrices lacinia. Proin nunc urna, mattis sed feugiat ut, porttitor et eros. Curabitur a odio ipsum. Sed lacinia blandit sem in lacinia. Proin sapien leo, feugiat nec aliquet a, semper quis urna. Morbi quis odio tortor. Proin quis libero non urna malesuada laoreet. Curabitur sed odio at ipsum tristique cursus et eu nulla.
    Proin rutrum accumsan feugiat. Praesent vehicula, sem non porta varius, mauris ipsum eleifend leo, nec mattis ligula est a massa. Nullam euismod orci quis augue commodo convallis. Duis gravida tempus ligula, eget ornare lacus elementum ut. Quisque vel fringilla tellus. Fusce nunc turpis, viverra eget consequat in, gravida sed felis. Fusce nunc nibh, blandit eget elementum et, luctus et velit. Curabitur sed sapien sapien, vel auctor dui. Proin cursus eros sed dolor varius commodo. In at nibh lacus, in condimentum ligula. Proin porta laoreet justo eget egestas. Ut euismod malesuada metus, ut placerat nisl pretium et.
    Quisque dignissim arcu at orci semper placerat. Donec vestibulum suscipit dui in interdum. Fusce aliquet dignissim leo quis elementum. Aenean massa arcu, porta ut porta non, fringilla at purus. Donec tortor libero, euismod quis blandit in, adipiscing in tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam interdum neque vulputate lacus tristique et facilisis leo ultrices. Suspendisse potenti. Sed commodo pretium orci id commodo. Mauris nulla est, commodo in sagittis id, mattis vitae tellus. Fusce vitae feugiat lectus. Pellentesque aliquet arcu eu nunc congue et blandit ipsum ornare.
    Praesent ac faucibus nisi. In hac habitasse platea dictumst. Sed vel turpis et neque sollicitudin imperdiet eu at sapien. Aenean volutpat sapien ac urna vulputate eu varius lacus luctus. Morbi eget lacus nunc. Duis hendrerit gravida nibh, sed mattis metus accumsan nec. Etiam ligula sapien, pellentesque ac consequat ut, tempus eget dolor. Phasellus turpis velit, scelerisque a bibendum sed, ultrices at odio. Suspendisse viverra sodales enim, vitae mattis lacus tempor ac. Nam eros purus, viverra vitae facilisis interdum, adipiscing non ante. Phasellus tristique turpis vitae nibh semper pulvinar.
    Nulla sit amet erat vel dui blandit auctor at at magna. Pellentesque ac augue nulla, accumsan sagittis lectus. Etiam lacinia rhoncus lectus, eget aliquet dui ornare ac. Curabitur et tortor malesuada nisl varius ullamcorper eget quis lorem. Sed ut enim nulla, at tempor nisl. Proin malesuada ullamcorper convallis. Quisque adipiscing, nunc a scelerisque porta, nulla massa tincidunt enim, quis imperdiet dolor tellus in quam. Duis pellentesque lacinia nisl gravida dignissim. Aliquam erat volutpat. Cras posuere eros vitae augue suscipit a venenatis nunc mollis. Nunc in diam eu justo dictum euismod non porta ipsum. Cras et libero velit. Duis fringilla ultricies elit sit amet dignissim. Sed euismod aliquam erat, eu varius lorem tristique sit amet. Morbi nisi magna, viverra vel tincidunt nec, pellentesque convallis lectus. Aliquam ac augue id tellus imperdiet elementum sed ut enim. Mauris tortor dolor, convallis vel hendrerit ut, rhoncus ac nisi. Aenean sodales sapien in velit dictum dapibus. Quisque ornare, massa a ornare porta, augue felis dignissim diam, a eleifend libero turpis quis elit. 
    "Hippies.They're everywhere. They wanna save the earth, but all they do is smoke pot and smell bad."-Cartman

  7. #7
    Join Date
    Jan 2010
    oh, that was neat , thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.10857 seconds
  • Memory Usage 3,102KB
  • Queries Executed 13 (?)
More Information
Template Usage (31):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (7)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (27):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./includes/functions_threadedmode.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (71):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates