Skip to content

Instantly share code, notes, and snippets.

@ericf
Created December 16, 2010 06:13
Show Gist options
  • Select an option

  • Save ericf/743102 to your computer and use it in GitHub Desktop.

Select an option

Save ericf/743102 to your computer and use it in GitHub Desktop.
var guide;
guide = new Y.TTW.Guide({
srcNode : '#welcome-guide',
width : '500px',
tabIndex : 0,
render : true,
centered : true,
zIndex : 250,
preventOverlap : true,
navigation : true,
children : [
{
boundingBox : '#welcome-guide-1',
srcNode : '#welcome-guide-1'
},
{
boundingBox : '#welcome-guide-2',
srcNode : '#welcome-guide-2',
align : {
node : '#create-tip',
points : [Y.WidgetPositionAlign.TC, Y.WidgetPositionAlign.BC]
},
after : {
selectedChange : Y.bind(function(e) {
var step = e.target,
handles = [];
function detach () {
Y.each(handles, function(h){
h.detach();
});
}
handles.push(guide.once('visibleChange', detach));
handles.push(step.once('selectedChange', detach));
handles.push(this.once('createTip:tip', function(e){
guide.selectChild(step.next().get('index'));
detach();
}));
}, this)
}
},
{
boundingBox : '#welcome-guide-3',
srcNode : '#welcome-guide-3',
align : {
node : '#created-tips',
points : [Y.WidgetPositionAlign.TC, Y.WidgetPositionAlign.BC]
}
}
],
plugins : [
{ fn: Y.Plugin.WidgetAnim },
{ fn: Y.Plugin.OverlayKeepaligned },
{ fn: Y.Plugin.OverlayAutohide, cfg: {
clickedOutside : false,
focusedOutside : false
}}
]
});
guide.syncUI();
return guide.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment