1
0
Fork 0

Can now show tryit area via hash

website
Mike Gerwitz 2011-04-04 22:37:13 -04:00
parent 3d879183c1
commit 3a98245628
1 changed files with 25 additions and 11 deletions

View File

@ -19,17 +19,25 @@
( function()
{
var $trybox = null;
var $trybox = null,
$trybtn = null
;
$( document ).ready( function()
{
appendTry();
if ( document.location.href.substr( -6 ) === '#tryit' )
{
console.log( 'ok' );
toggleTry();
}
} );
function appendTry()
{
$( '<div>' )
$trybtn = $( '<div>' )
.attr( 'id', 'try' )
.text( 'Try It!' )
.addClass( 'btn large glow' )
@ -41,20 +49,26 @@
} )
.click( function( event )
{
var $try = getTry();
$( this ).text(
( $try.is( ':visible' ) )
? 'Try It!'
: 'Hide It'
);
$try.slideToggle();
toggleTry();
} )
.appendTo( '#header' );
}
function toggleTry()
{
var $try = getTry();
$trybtn.text(
( $try.is( ':visible' ) )
? 'Try It!'
: 'Hide It'
);
$try.slideToggle();
}
function getTry()
{
var $txt;