PDA

View Full Version : Expand dialog animation



Alidad
27 Jan 2007, 12:55 PM
Hi, I have create hello world dialog part of sample code from jack, and I'm trying to create expland animation to resize to make wider.

They are two tab there, and i put expland animation code in second tab, part of this i'm confused of how i can create button to expland. please see code in BOLD, dose anyone can help me how i can create button to link that funtion to expland it!

----------------
<script type="text/javascript">
var HelloWorld = function(){
var dialog, showBtn;
return {
init : function(){
showBtn = getEl('show-dialog-btn');
// attach to click event
showBtn.on('click', this.showDialog, this, true);
},

showDialog : function(){
if(!dialog){ // lazy initialize the dialog and only create it once
dialog = new YAHOO.ext.BasicDialog("hello-dlg", {
//modal:true,
resizable:false,
autoTabs:true,
modal:true,
draggable:false,
width:420,
height:300,
shadow:true,
minWidth:300,
minHeight:250,
proxyDrag: true

});

}


dialog.show(showBtn.dom);
// dialog.getTabs('jtabs');
if(!dialog.getTabs().getTab('jtabs-1'))
{
var tabs = dialog.getTabs();
tabs.addTab('jtabs-1', "First Tab");

var tab2 = tabs.addTab('jtabs-2', "Tab 2");
var updater = tab2.getUpdateManager();



isc.IButton.create({
title:"Expand",
click:"ajaxDefinition.animateResize(310,195);"
})

isc.IButton.create({
title:"Collapse", left:120,
click:"ajaxDefinition.animateResize(75,45);"
})

tab2.onActivate.subscribe(updater.refresh, updater, true);

}
}
};
}();

YAHOO.ext.EventManager.onDocumentReady(HelloWorld.init, HelloWorld, true);
</script>

Bobafart
27 Jan 2007, 1:31 PM
I don't think you meant to paste your code the way you did-- your UBB bold tags screwed up the way you pasted your code I believe.


Barring that I fail to see where you defined isc

perhaps some of your code is missing

do you define isc anywhere?

Animal
28 Jan 2007, 10:11 AM
You want to know how to create a button??

Wouldn't you just have



<button type="button" id="show-dialog-btn">Open Dialog</button>
:?: :?: :?: :?: :?: :?:

Or in fact



<any-html-element id="show-dialog-btn">Open Dialog</any-html-element>
:!: :!: