DEVHIDE
        • Home (current)
        • About
        • Contact
        • Cookie
        • Home (current)
        • About
        • Contact
        • Cookie
        • Disclaimer
        • Privacy
        • TOS
        Login Or Sign up

        Horizontal touch scroll on mobile with text

        2.9k Views Asked by frosthammer13 At 12 June 2015 at 14:08 2025-12-13T04:10:41.880834

        I found a solution online that handles horizontal scrolling on mobile devices just fine.

        <div style="max-width: 1024px; margin: auto; ">
           <ul style="white-space: nowrap; overflow-y: hidden; overflow-x: scroll; -webkit-overflow-scrolling: touch; ">
             <li style="display: inline-block; width: 240px;">
        

        The problem that I am having is that within the li tag I have some conditional php echoing out a title. Because of the nowrap the title breaks through the li width. If I remove the nowrap the title is contained within the width limits but the scroll doesn't work. I have used php and js to create line breaks in the text but the scroll still fails.

        Looking for help on this one.

        html css mobile webkit
        Original Q&A
        1

        There are 1 best solutions below

        2
        vinzcelavi vinzcelavi On 12 June 2015 at 14:31

        I'm not sure to understand what you would expect to do.

        Why don't you wrap your title in another tag like this:

        <div style="max-width: 1024px; margin: auto; ">
          <ul style="white-space: nowrap; overflow-y: hidden; overflow-x: scroll; -webkit-overflow-scrolling: touch; ">
            <li style="display: inline-block; width: 240px;">
              <span style="display: block; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
                Your title goes here
              </span>
            </li>
          </ul>
        </div>
        

        Related Questions in HTML

        • Delay in loading Html Page(WebView) from assets folder in real android device
        • Why does a function show up as not defined
        • CSS Class is not applying to element (border width,color,and style attributes)
        • How to sort these using Javascript or Jquery Most effectively
        • how to fill out the table with next values in array with one button
        • Automatically closing tags in form input?
        • Positioning child at bottom of parent with scroll
        • Remove added set of rows
        • Website zoomed out on Android default browser
        • Twitter Bootstrap horizontal form elements on a line
        • http://sigmajs.org/ les mis tutorial - why are my canvases 0 height?
        • My navbar is not expanding after collapse
        • when a checkbox is checked how to display a different hidden element using javascript
        • Gaps Vertically Using Dividers
        • Svg containers not positioning properly

        Related Questions in CSS

        • CSS Class is not applying to element (border width,color,and style attributes)
        • How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
        • Positioning child at bottom of parent with scroll
        • Play multiple audio files in a slider
        • How to set text over image?
        • Website zoomed out on Android default browser
        • Writing/Overwriting to specific XML file from ASP.NET code behind
        • My navbar is not expanding after collapse
        • when a checkbox is checked how to display a different hidden element using javascript
        • Gaps Vertically Using Dividers
        • CSS: Preventing a property to affect on element until the end of transition
        • Polygon Button with pure CSS
        • transform-origin doesnt apply in safari
        • show/hide multiple div tags at once and change the size of the remaining div tag
        • Mask the image/maps/div (circle) using css and jquery

        Related Questions in MOBILE

        • Is there a way to save offline google map on hybrid mobile app on ionic?
        • Is there a data format lighter than json?
        • Using Azure MobileServices library with my own LAN WebApi
        • Chack number from contacts is mobile or fixed line(landline) number
        • ng-click event not getting cleared in Ionic app
        • Javascript Battery API returning Infinite discharging time
        • Saving images as a burst on iOS
        • Fastest/easiest way to build a HTML5 mobile app (agile)
        • can Adobe Flash CS6 export for mobile correctly?
        • How do I vertically fix an element in a mobile browser but still allow for horizontal scroll?
        • Jquery Mobile: Horizontal Buttons, fill container
        • How to make :hover more mobile friendly and accessible?
        • Launch a web browser or youtube using textview in android
        • I'm using htaccess to redirect mobile users from desktop to website but i keep getting the $_GET variables inside
        • How to Remove class or activate class for specific view port only

        Related Questions in WEBKIT

        • Getting X Cursor in WebKit GTK2+ widget if run by startx
        • "Card" rotation and selectable text
        • Opentype features cross-browser compatibility
        • Using backface-visibility on * elements
        • Custom SVG progress bar fill
        • UI event processing by browser
        • Horizontal touch scroll on mobile with text
        • Webkit - fix positioned elements seem to have inherent stacking context
        • Why is touchstart event after click?
        • Why won't Facebook "Like" Button Scale on iOS Safari?
        • Best option for converting a JSP website to Android app?
        • Get Bytebuffer from JavaFX Browser
        • Use Cordova with Webkit instead of the native engine
        • Transfer big file to selenium grid node
        • Webkit transition is working in chrome but not firefox

        Trending Questions

        • UIImageView Frame Doesn't Reflect Constraints
        • Is it possible to use adb commands to click on a view by finding its ID?
        • How to create a new web character symbol recognizable by html/javascript?
        • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
        • Heap Gives Page Fault
        • Connect ffmpeg to Visual Studio 2008
        • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
        • How to avoid default initialization of objects in std::vector?
        • second argument of the command line arguments in a format other than char** argv or char* argv[]
        • How to improve efficiency of algorithm which generates next lexicographic permutation?
        • Navigating to the another actvity app getting crash in android
        • How to read the particular message format in android and store in sqlite database?
        • Resetting inventory status after order is cancelled
        • Efficiently compute powers of X in SSE/AVX
        • Insert into an external database using ajax and php : POST 500 (Internal Server Error)

        Popular # Hahtags

        javascript python java c# php android html jquery c++ css ios sql mysql r reactjs

        Popular Questions

        • How do I undo the most recent local commits in Git?
        • How can I remove a specific item from an array in JavaScript?
        • How do I delete a Git branch locally and remotely?
        • Find all files containing a specific text (string) on Linux?
        • How do I revert a Git repository to a previous commit?
        • How do I create an HTML button that acts like a link?
        • How do I check out a remote Git branch?
        • How do I force "git pull" to overwrite local files?
        • How do I list all files of a directory?
        • How to check whether a string contains a substring in JavaScript?
        • How do I redirect to another webpage?
        • How can I iterate over rows in a Pandas DataFrame?
        • How do I convert a String to an int in Java?
        • Does Python have a string 'contains' substring method?
        • How do I check if a string contains a specific word?
        .

        Copyright © 2021 Jogjafile Inc.

        • Disclaimer
        • Privacy
        • TOS
        • Homegardensmart
        • Math
        • Aftereffectstemplates