JSFiddle - React, Tailwind, and code Playground

by estevao_lucas

HTML

<a href="http://jsfiddle.net/estevao_lucas" target="content" rel="about">About</a> 
<a href="http://jsfiddle.net" target="content" rel="home">Home</a> 

<iframe id="content" name="content" align="top" src="http://jsfiddle.net/" frameborder="0" width="100%" height="1200px" scrolling="no">
</iframe>

JavaScript

var iframe = $( "iframe" );

$( "a[target=content]" ).click( function()
{
    window.location.hash = $( this ).attr( "rel" );

    iframe
        .slideUp()
        .attr( "src", this.href )
        .load( function()
        {
            iframe.slideDown();
        });

    return false;
})

if( window.location.hash )
    $( "a[rel=" + window.location.hash.replace( "#", "" ) + "]" ).trigger( "click" );
else
    iframe.show()