Skip to content

Instantly share code, notes, and snippets.

@tcarlsen
Created April 16, 2014 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcarlsen/10859849 to your computer and use it in GitHub Desktop.
Save tcarlsen/10859849 to your computer and use it in GitHub Desktop.
jens
$(document).ready(function () {
var location = window.location.href;
var hashtag = (location.split('#/')[1] || 'jens/start').split('/');
var page = hashtag[1];
if (hashtag[0] !== 'jens') {
page = 'start';
}
// * Home button * //
var home = $('<home />')
.css({
'position': 'absolute',
'left': '343px',
'font-family': 'b-sans-r',
'top': '67px',
'background': '#FFF',
'border-radius': '10px',
'padding': '2px 7px 4px 7px',
'border': 'solid',
'border-width': '1px',
'border-color': 'rgb(215, 25, 32)',
'cursor': 'pointer'
})
.html("Tilbage til Jens' hjem ")
.bind('click', function () {
$('#graphicFrame')
.contents()
.find('content')
.animate({
'opacity': '0'
}, 300, 'linear', function () {
$('#graphicFrame')
.contents()
.find('.start')
.css({
'opacity': '1'
});
$('#graphicFrame').attr('src', 'index.html#start');
$('home')
.css({
'display': 'none',
'opacity': '0'
});
});
window.location.hash = '#/jens/start';
});
if (page === 'start') {
home.hide();
}
$('#jens-top')
.html('<img src="images/top/logo_top.png" width="329px" height="100px"/>')
.css({
'padding-left': '14px',
'padding-bottom': '5px',
'padding-top': '5px',
'background-image': 'url("images/top/top_back.png")',
'width': '926px',
'border-bottom': 'solid',
'border-bottom-width': '2px',
'border-bottom-color': 'rgb(215, 25, 32)'
})
.prepend(home);
$('#jens-frame')
.html('<iframe id="graphicFrame" src="index.html#' + page + '" width="940" height="700" scrolling="no" frameborder="0" data-infogfx="Klik her for at se infografikken"></iframe>');
$('body').css({
'margin': '0px'
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment