Created
May 6, 2013 23:35
-
-
Save csessig86/5529158 to your computer and use it in GitHub Desktop.
Responsive maps blog 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Toggle for 'About this map' and X buttons | |
// Only visible on mobile | |
isVisibleDescription = false; | |
// Grab header, then content of sidebar | |
sidebarHeader = $('#sidebar_header').html(); | |
sidebarContent = $('#sidebar_content').html(); | |
// Then grab credit information | |
creditsContent = $('#credits_content').html(); | |
$('.toggle_description').click(function() { | |
if (isVisibleDescription === false) { | |
$('#description_box_cover').show(); | |
// Add Sidebar header into our description box | |
// And 'Scroll to read more...' text on wide mobile screen | |
$('#description_box_header').html(sidebarHeader + '<div id="scroll_more"><strong>Scroll to read more...</strong></div>'); | |
// Add the rest of our sidebar content, credit information | |
$('#description_box_content').html(sidebarContent + '<br />' + 'Credits:' + creditsContent); | |
$('#description_box').show(); | |
isVisibleDescription = true; | |
} else { | |
$('#description_box').hide(); | |
$('#description_box_cover').hide(); | |
isVisibleDescription = false; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment