From: David C. <dle...@ya...> - 2001-03-14 07:04:58
|
Greetings all, This widget is just about complete. scrposit.js What it does: Returns the left x, top y, right x, bottom y, center x and center y of the visible browser screen with respect to whether the scrollbars are visible or not. These values are available to other code by using: DynAPI.sizr.vlx left x-coordinate DynAPI.sizr.vty top y-coordinate DynAPI.sizr.vrx right x-coordinate DynAPI.sizr.vby bottom y-coordinate DynAPI.sizr.vCX center x-coordinate DynAPI.sizr.vCY center y-coordinate Allows the scrollbars to be forced on or off. Allows the width or height of the scrollbars to be added to the returned co-ordinates. Returns an event on browser resize (sresize) browser scroll, even in NS (sscroll) and scroll finished (sFscroll). It creates a DynPI.onResize function that in turn fires the "sresize". Possible uses: Layer positioning to appear in the viewable area of the browser (no hiding behind the scrollbars). Layer lock for menus or help bars. The "dreaded" watermark scrolling technique. Returns the size independant of document.getWidth/getHeight so if oversize pages are being used, you can still get the browser window visible co-ordinates. Usage: 1 line at the beginning of the on load: var_name = new ScrPosit() Arguments: (add_scrollbar_val,set_scroll,set_doc_size,set_doc_width,set_doc_height,force_scrollbars_on,hide_scrollbars) add_scrollbar_val true or false use to add the scrollbar dimensions to the returned values set_scroll true or false turns on the scrolling monitor code set_doc_size true or false sets the document.width/height in ns4 also needed to save following values in ie and ns6 set_doc_width number set_doc_height number force_scrollbars_on true or false Sets a 1pixel layer at the correct position to make the browser window default to the previous settings and thus forcing on the scrollbars. hide_scrollbars true or false will force the scrollbars off I am still working on the usage page, but here are some examples. Note that sometimes it is neccesary to hit the get values to see the results if the scrolling code is not active, it updates on a lot of events, but the screen update is not part of the widget code Menu lock and scrolling watermark: http://www.merlinsworld.net/dynapi_ri_dcexamples/dc_sposit_exmpl_4.shtml Evaluation page: http://www.merlinsworld.net/dynapi_ri_dcexamples/dc_sposit_exmpl_2.shtml Scrolling Evaluation page: http://www.merlinsworld.net/dynapi_ri_dcexamples/dc_sposit_exmpl_3.shtml the widget is attached here. Note: the horizontal scrollbar is not detectable in NS6 due to a "bug" in NS6. For now it is locked to the vertical bar, and will error to the inside dimension (coordinate will never be obscured by the scrollbar) Comments? Suggestions? Cheers, Dave C. "You Changed What?!?" __________________________________________________ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.yahoo.com/ |