Results 1 to 3 of 3

Thread: Using Cartesian x,y coordinates.

  1. #1
    Join Date
    Apr 2003

    Using Cartesian x,y coordinates.

    I have been having trouble getting page elements to be positioned as I want them to be. Especially a form.

    I have found a free javascript that places a (function getMouseXY(e) ) on a locally viewable html page. This simple script shows the mouse coordinates in (x,y) values wherever the mouse is moved. Making this js work for a local page to view has been instructive in so far as it can tell me the cartesian x,y allocation of where I want stuff to be placed on another page in the making. So, I am wanting to use x-y coordination to allocate page elements and content. Can anyone provide a tutorial about this?
    have not been able to find much and most references to 'positioning' seem to only discuss the use of px, em, align, %,...etc. It seems to me that using cartesian (x,y) coorordination would be easier but why is this not more used? If anyone opens a page with x,y coords used and they have their display settings different from mine used to make the page,...is not the display 'relative' to any settings...so that page content will display in a relative way only in a larger, equal or smaller 'field displayed' ?

    Also, if one were to use x,y page coords to allocate for example a TABLE,... what is the method? It should, I think be a simple matter of allocating a box or rectangular area to a given

    total page area that is simply "maximum X times y" area,
    (and related the user's monitor size and the settings)

    right? Do the values (for all lesser x times y areas ...tables, objects and forms, etc ...content that requires allocationing..) designate the table's upper left corner starting locus for the table as width and height designations define the rest. this would be great if it could do this.

    Any, links or comments about X,Y page coordination.??


  2. #2
    Join Date
    Feb 2003
    Michigan, USA
    The closest you're going to get for what you want is using CSS positioning. You would use the following two properties:

    left: ##px; - specifies the number of pixels from the left side of the page you want the element to appear.

    top: ##px; - specifies the number of pixels from the top side of the page.

    If you want the element positioned relatively, depending on the users's monitor resolution, then you can use percentages. As far as I know, there is no way to use a Cartesian Coordinate system in the same syntax that you want. The method I mentioned above is the same thing, it's just written differently from (X,Y).

    left: /* The X value */
    top: /* The Y value */

    Then you should position everything absolutely. In CSS:

    position: absolute;
    left: ##px;
    top: ##px;


    the only problem is, if you're dealing with text, Mac and Netscape users can increase text size regardless of how you specify text sizes in CSS (px, %, relative, points...). You would also need to specify the width and height of each element. Then if someone has increased the text size displayed in their browser by way of their browser settings, text may overlap the edges of the elements you made. Then in CSS:

    position: absolute;
    left: ##px;
    top: ##px;
    width: ##px;
    height: ##px;
    overflow: auto;


    The last property, overflow, tells the browser what it should do with content that spills over the edges of the element that contains it. In this case, it would cause the browser to display scroll bars if it should need them.

    Pretty much everyone that I know who uses CSS to lay out a page, including me, recomends NOT using absolute positioning and depending on specifically sized elements. In web design, there is NO guarantee that text will be a certain size and that a viewer's screen will be a certain width. It's one of the finer miseries of what we do.

    You could using pixel perfect positioning, depending on what you are doing on the site. If you are laying out text areas, avoid pixel-perfect positioning like the plague. It always gives more headaches than it cures.

    Are you coding in XHTML using CSS to lay the pages out? If so, visit http://www.alistapart.com/. It has a bunch of info on CSS layouts.

  3. #3
    Join Date
    Apr 2003

    Why x an Y

    Hi toicontien

    >It's one of the finer miseries of what we do.
    LOL, I have discovered the nature of such misery!
    Yesterday, I down-loaded Netscape browser (which I had removed long ago in favor of aol's IE as they seemed to have had conflicts in the past working on the same pc.
    They seem to be getting along better so far. And with both to compare...I have had the surprise of finding out the pages(i have made) display differently in the two (main?) different browsers. I'm not really concerned about the other browsers yet,...just making some educational and hobby sites and
    no big commercial endeavors until April 39th.

    I want to see how using the X-Y coordinates will work and be easier or not according to certain tasks. As I see it my success with this must generally depend upon to what extent a DOM element (?) called a "PIXEL" is a constant object (which I think it should be, yet I need to learn more about all of this as it does implicate things like bit and bytes and binary code per pixel, etc). In the final analysis there is only so many PIXEL that can fill a standard area (inch or whatever) ...unless a pixel is not constant! The Universe is Relativistic but it ant all that Relativistic! So maybe someone can elaborate. Is the PC + DOME "set" dependent upon a constant definition of the pixel object or not? Maybe there is some great fractal mystery.
    Any way thanks for the info, and I will try to do some experimenting with the Cartesian coordination using some of what you have elucidated from the abysm of visual acuity...(I have been too busy today watching the angry mob be-head the evil one of Punt) and the other ways to see if I can figure out what i am doing.
    __ JHG

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.19369 seconds
  • Memory Usage 2,862KB
  • Queries Executed 13 (?)
More Information
Template Usage (32):
  • (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
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (3)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./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
  • ./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 (70):
  • 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
  • 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