From: David C. <dle...@ya...> - 2001-03-14 07:04:58
Attachments:
dcutil_scrposit.zip
|
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/ |
From: Richard B. <ma...@ri...> - 2001-03-15 13:46:04
|
Well it's certainly interesting stuff, if not a little complicated, I'm glad you included example 4, which shows a practical application. the other examples are throwing an error in IE5.5 at the moment. I don't quite understand why you limit the screen size to 800*600, or is that something else? Is this controlling the visibility of browser scrollbars in NS4/IE ? what are the main differences (apart from the implementation) between this and Henrik's layerpos? http://www.resass.f2s.com/dynapi/Henrik_Vaglin_Examples/ccreation.ext.layerp os.htm (url wraps) Keep up the hard work, have you reached any conclusions on the timing issues yet? Cheers, Richard Bennett ma...@ri... www.richardinfo.com (Everything running on, and ported to the 19/12/2000 snapshot of DynAPI2) visit the DynAPI homepage (and FAQ) :: http://dynapi.sourceforge.net/dynapi/index.php?menu=1 Browse (and search) the mailinglist here: http://www.mail-archive.com/index.php3?hunt=dynapi ----- Original Message ----- From: "David Cushman" <dle...@ya...> To: "dynapi widget" <dyn...@li...> Sent: Wednesday, March 14, 2001 8:06 AM Subject: [Dynapi-Widgetdev] Browser Window Visible co-ordinate widget for test > 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,forc e_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/ |