Creates a div within the page with the specified contents at the location relative to the element you specify; basically an in-page popup maker.
| Moo | Moo.js, Common.js, Utility.js, Element.js, Function.js, Dom.js, Array.js, Window.Base.js, Window.Size.js, <Events.js> |
| CNET | element.shortcuts.js, element.dimensions.js, element.position.js, element.pin.js, IframeShim.js |
Aaron Newton (aaron [dot] newton [at] cnet [dot] com)
| stickyWin.js | Creates a div within the page with the specified contents at the location relative to the element you specify; basically an in-page popup maker. |
| StickyWin | Creates a div within the page with the specified contents at the location relative to the element you specify; basically an in-page popup maker. |
| Properties | |
| show | Shows the popup. |
| hide | Hides the popup. |
| setContent | Replaces the content of the popup with the content passed in. |
| pin | Affixes the stickywin to a fixed position, even if the window is scrolled. |
| unpin | Affixes the stickywin to a fixed position, even if the window is scrolled. |
| togglepin | Toggle the pinned state of the Sticky; |
| destroy | Removes the popup element. |
| Change Log | $Source: /cvs/main/flatfile/html/rb/js/global/cnet.global.framework/common/js.widgets/stickyWin.js,v $ $Log: stickyWin.js,v $ Revision 1.24 2007/05/29 22:01:53 newtona Split element.cnet.js into seperate files; updated docs in files to note this Changed element.visible to element.isVisible (left old namespace for legacy support) Fixed Element.empty in prototype.compatibility.js Removed as many dependencies in common code to element.*.js as possible (espeically element.shortcuts.js) |
Creates a div within the page with the specified contents at the location relative to the element you specify; basically an in-page popup maker.
| options | an object with key/value options |
| onDisplay | function to execute when the popup is shown |
| onClose | function to execute when the popup is closed |
| closeClassName | class name of the element(s) in your popup content that, when clicked, should close the window; defaults to “closeSticky” |
| pinClassName | class name of the elements(s) in your popup content that, when clicked, should pin the sticky in place; defaults to “pinSticky” |
| content | the content of your popup; this should be layout html and your message or a dom element |
| zIndex | the zIndex of the popup; defaults to 10000 |
| id | the id of the wrapper div that gets created that will contain your content; defaults to ‘StickyWin’ + the date (so it’s unique) |
| className | optional class name for the wrapper dive that gets created that will contain your content |
| position | ”center”, “upperRight”, “bottomRight”, “upperLeft”, “bottomLeft”; the point in the popup that is positioned; defaults to ‘center’ |
| edge | same options as position (center, upperRight, etc.) but specifies the edge of the stickyWin to position to the point specified in position. see Element.setPosition for details. Optional; defaults to the Element.setPosition default state. |
| offset | object containing {x: # and y: #} (integers) the top and left offset from the element in the page that the popup is relative to; this offset is applied to the center of the popup or the corner, depending on the value you specify in the ‘position’ option. |
| relativeTo | a dom element to position the popup relative to; defaults to document.body (i.e. the window) |
| width | an optional width for the wrapper div for your popup |
| height | an optional height for the wrapper div for your popup |
| timeout | (integer) an optional timeout interval to hide the popup after a specified time |
| allowMultiple | (boolean) allow multiple instance of StickyWin on the page; defaults to true |
| allowMultipleByClass | (boolean) allow multiple popups that share the same className as specified in the className option; defaults to false |
| showNow | display the popup on instantiation; defaults to true |
| useIframeShim | use an IframeShim to mask content below the element; defaults to true. |
| iframeShimSelector | the css selector to find the element within your popup under which the iframe shim should be placed to obscure select lists and the like (see IframeShim) |
var myWin = new StickyWin({
content: '<div id="myWin">hi there!<br><a href="javascript:void(0);" class="closeSticky">close</a></div>'
});
//popups up a box in the middle of the window with "hi there" and a close link(end)| Properties | |
| show | Shows the popup. |
| hide | Hides the popup. |
| setContent | Replaces the content of the popup with the content passed in. |
| pin | Affixes the stickywin to a fixed position, even if the window is scrolled. |
| unpin | Affixes the stickywin to a fixed position, even if the window is scrolled. |
| togglepin | Toggle the pinned state of the Sticky; |
| destroy | Removes the popup element. |
Affixes the stickywin to a fixed position, even if the window is scrolled. See Element.pin.
Affixes the stickywin to a fixed position, even if the window is scrolled. See Element.unpin.
$Source: /cvs/main/flatfile/html/rb/js/global/cnet.global.framework/common/js.widgets/stickyWin.js,v $ $Log: stickyWin.js,v $ Revision 1.24 2007/05/29 22:01:53 newtona Split element.cnet.js into seperate files; updated docs in files to note this Changed element.visible to element.isVisible (left old namespace for legacy support) Fixed Element.empty in prototype.compatibility.js Removed as many dependencies in common code to element.*.js as possible (espeically element.shortcuts.js)
Revision 1.23 2007/05/11 00:10:48 newtona syntax fix
Revision 1.22 2007/05/11 00:05:29 newtona adding clearfix css to all sticky win instances
Revision 1.21 2007/05/04 01:22:47 newtona added togglepin
Revision 1.19 2007/05/04 00:32:39 newtona stickwinHTML: added the ability for buttons to not close the sticky (className option) stickyWin: added .pin (see Element.pin.js)
Revision 1.18 2007/04/13 19:06:11 newtona dependency update in the docs
Revision 1.17 2007/03/30 19:32:20 newtona changing .flush to .empty
Revision 1.16 2007/03/29 23:12:00 newtona confirmer now checks for a bg color in IE6 to use crossfading (see Element.fxOpacityOk) fixed an IE7 css layout issue in stickyDefaultHTML StickyWin now uses Element.flush StickyWinFx.Drag now temporarily shows the sticky win (with opacity 0) to execute makeDraggable and makeResizable to prevent a Safari bug
Revision 1.15 2007/03/23 23:01:16 newtona stickywin: implemented current options options method (no functional change) stickywinFx: removed an old function that was empty; should have been gone a long time ago (getDefaultOptions)
Revision 1.14 2007/03/23 20:19:48 newtona Iframeshim: added className; updated docs StickyWin: added edge support (see Element.setPosition)
Revision 1.13 2007/03/08 00:06:13 newtona stickyWin now empties it’s content before setContent adds new stuff
Revision 1.12 2007/02/21 00:24:56 newtona no change, but cvs says it’s different. maybe a space?
Revision 1.11 2007/02/08 22:54:00 newtona removed a comment
Revision 1.10 2007/02/08 20:50:54 newtona fixed a bug where .show repositioned the window every time
Revision 1.9 2007/02/08 01:29:51 newtona fixed syntax error
Revision 1.8 2007/02/07 20:51:41 newtona implemented Options class implemented Events class StickyWin now uses Element.position
Revision 1.7 2007/01/26 18:24:41 newtona docs update
Revision 1.6 2007/01/26 05:49:10 newtona syntax update for mootools 1.0
Revision 1.5 2007/01/23 20:54:24 newtona a little better position handling
Revision 1.4 2007/01/22 22:00:15 newtona numerous bug fixes to modalizer, stickywin, and popupdetails updated for mootools 1.0 fixed date validation in form.validator
Revision 1.3 2007/01/19 01:22:32 newtona fixed a few syntax errors
Revision 1.2 2007/01/11 20:55:23 newtona changed the way options are set, split up stickywin into 4 files, refactored popupdetails to use stickywin and modalizer
Revision 1.1 2007/01/09 02:39:35 newtona renamed addons directory to “common” directory
Revision 1.2 2007/01/09 01:26:04 newtona docs syntax fix
Revision 1.1 2007/01/05 19:29:30 newtona first check in
returns the element passed in with all the Element prototypes applied.
function $( el )
function $A( array, start, length )
Use to iterate through iterables that are not regular arrays, such as builtin getElementsByTagName calls, arguments of a function, or an object.
function $each( iterable, fn, bind )