All pastes #199687 Raw Edit

Someone

public text v1 · immutable
#199687 ·published 2006-10-12 18:06 UTC
rendered paste body
<script>
box = function( options ){
	this.options = {
		header: 'Box Header!'
	};

	for( key in options )
	{
		this.options[ key ] = options[ key ];
	}
	
	this.node =$.DIV(
				{	class:'box', id: this.options['id']	},
				
				$.DIV(
					{	class:'boxHeader', id: 'boxHeader_' + this.id },
					this.options[ 'header' ]
				),
				
				$.DIV(
					{	class:'boxContent', id: 'boxContent_' + this.id }
				),
				
				$.DIV(
					{	class:'boxCommands', id:'boxCommands_' + this.id	},
					$.IMG(	{src:'http://static.daytradercanada.com/images/icons/silk/icons/application_side_boxes.png', class:'command'	} ),
					$.IMG(	{src:'http://static.daytradercanada.com/images/icons/silk/icons/anchor.png', class:'command'	} ),
					$.IMG(	{src:'http://static.daytradercanada.com/images/icons/silk/icons/asterisk_orange.png', class:'command'	} ),
					$.IMG(	{src:'http://static.daytradercanada.com/images/icons/silk/icons/attach.png', class:'command'	} ),
					$.IMG(	{src:'http://static.daytradercanada.com/images/icons/silk/icons/cancel.png', class:'command'	} )
				)
	);
	
	return this.node;
}

$( document ).ready( function(){
		boxInst = new box( { id:'testBox' } );
		$('body').append( boxInst );
		$( '.box' ).find( 'div.boxHeader' ).bind( 'dblclick', function(){ $( 'div.box' ).find( '.boxContent' ).toggle(); $( 'div.box' ).find( '.boxCommands' ).toggle(); } );
		
	}

	);

</script>