I've been experimenting with this code snippet, trying to get it to work better. It's still a work in progress as I'm new to this and have only customized it for my phone so far. The issue can be seen by clicking on the Projects and Today tabs.
Within the div (#data-container
), there are two child divs (.project, .today
) that I want to display side by side like tabs. When clicked, they should swipe and show their respective content. While I have managed to make it functional, I am encountering two problems.
Functionality Explanation - The #data-container
has white-space: nowrap
set (to keep child divs side by side and enable sliding functionality) while its child divs (.project and .today
) have widths set to 100%
and are positioned as inline-block
.
Issues Encountered
The
data-container
is required to allow vertical scrolling and wrap text around the selected div. However, usingwhite-space: nowrap
causes text overflow. Attempts to resolve this usingword-wrap: break-word
have been unsuccessful. Although settingdisplay: hidden
resolves the issue, it interferes with the swiping functionality desired.An unexpected complication arises when setting
#data-container
tooverflow-y: scroll
, causing the divs to scroll horizontally, disrupting the entire system.
A solution is needed to enable vertical scrolling within data-container
while maintaining text wrapping functionality.
Jade Code Snippet
extends ./layout.jade
block content
#maindiv
.sidebar
// Sidebar Content
header
// Header Content
.container
// Container Content
Associated CSS Styles
.container {
// CSS styles for container
}
// Additional CSS styling properties
JavaScript Animation Functionality
// JavaScript animation functions
// Sample JavaScript code block provided
// Sample CSS code block provided
<div id="maindiv">
<div class="sidebar">
// Sidebar HTML content
</div>
<header>
// Header HTML content
</header>
<div class="container">
// Main container HTML content
</div>
</div>