How can we make horizontal scrollbar? - javascript

I need to add horizontal scrollbar. It should have same interface for all browsers and compatible with android, windows, tablets etc.

Customize the scrollbar and make it cross-browser it's still complicated with full CSS.
Webkit-based browser make the customisation possible with CSS only as you do. But your snippet doesn't work even on Firefox, for example.
Maybe you should have a look to some JS plugins, in particular this one what I had to use in the past.
Demo
Don't be afraid with the theme, you can create yours. You'll find a tutorial to do it here.
Hope this helped you, even if it's not a full-CSS solution but this is the only way I know to deal with stylised scrollbar.

Related

Cross browser - Mobile compatible custom Scroll Bar

As of 2017, is there a way to implement a cross-browser and mobile inclusive custom scrollbar, that supports events for an infinite-scroll (in case of a plugin)?
This question has been asked and answered here, however, this was 5 years ago with the accepted answer last updated on 2014, so I'm hoping for an up-to date answer to this subject.
Some things i have tried:
Custom Css (not compatible with all browsers, i'm testing for IE10+ and other modern browsers)
Most starred git project perfect-scrollbar (Scrollbar won´t be displayed on mobile)
Sly (2.7k stars on github) - (seems good, not tested for mobile though
jquery.nicescroll - seems like it's not supported anymore
I use Custom Content Scroller aka mCustomScrollbar
http://manos.malihu.gr/jquery-custom-content-scroller/
I tested on mobile and many browsers and work perfectly... btw CSS is not implemented on all browsers yet... I think that CSS is not good choice to change scrollbar appearance at this moment...
What can you do is check some repositories, drill dip in code and decide if you want to rewrite it in your own manner or just reuse it as is.
Below some links to github scrollers maybe first on is mostly suit.
simplebar
jquery custom scroller
Maybe if you will provide more details with live example and expected devices, you will get more answers.

Parallax animations and iOS scrolling

I've created a website using SUPERSCROLLORAMA plugin. I wasn't aware of the problems with parallax scrolling on iPad and iPhone. I've found out a little bit to late, and I'm thinking about the ways to solve this.
If I understand correctly, events are disabled on this devices while scrolling. So will I be able to make website act as it should, if I disable the native scrolling and implement another one, via JavaScript plugin?
I've already disabled the original scrolling using Alnitak's answer from this question. I've tried to find some plugins to activate scrolling again, but the problem is, it has to be binded to the document since animations are fired there... Do you know the plugin that will do the trick? Is my solution even correct, or there is no solution for my case, I need to rewrite the script from scratch?
You can use parallax scrolling plugin that works on mobile browsers (iOS too).
Have a look at Skrollr. It doesn't depend on any other library, it has optional mobile js file and is very easy to use. Just read the documentation.

Html5 for mobile - swipe scrolling

I'm working on a few html5 screens which will be embedded inside native mobile apps (for ios and android).
I obviously don't want to reinvent things here, and would like to use a stable framework on the javascript side of things.
I tried using JQuery Mobile but it is way more than I need, plus they kind of force you to do things their way.
All I need is to have an element which can be (vertically) scrolled by swiping (without visible scrollbars), but I couldn't find how that can be done with JQM easily (without all of their widgets, themes and defaults).
I also tried jGestures but it did not work at all.
Any ideas what will be the best approach?
Thanks.
Update
I found this jquery plugin which does what I need: https://github.com/ifightcrime/touch-scroll
You can use -webkit-overflow-scrolling: touch; which uses the native inertia scrolling built into the phone. Works really well. There is a scrollbar, but I'm sure some clever positioning could solve that.
More info here: http://johanbrook.com/browsers/native-momentum-scrolling-ios-5/
And here: http://fioravengi.blogspot.co.uk/2011/06/implications-of-ios-5-webkit-overflow.html
Hope that helps :)
edit: Sorry, just realised you need it to work on android. I doubt this does. For iOS though this works a treat. So, half an answer!

Need a simple custom scrollbar

I have a div that is overflow-y: hidden; overflow-x: auto; and rendering a scrollbar exactly the way I want. I have all of the scrolling functionality and everything I want perfect already. Now, all I want to do is replace the default browser scrollbar with a custom one.
It needs to work in PC IE7+ and Firefox and Mac Safari so it'll need to be JavaScript or jQuery. I've already tried four different plugins that I've found, but none of them worked either because of the version of jQuery (1.6.2), didn't work in all the browsers necessary, or wouldn't work for a horizontal scrollbar, etc. The ones I tried were jQuery UI's slider, jQuery Custom Scrollbar, Tiny Scrollbar and jScrollPane.
I'm hoping there's a simple plugin out there, but I can't seem to find it.
I've used Flexcroll several times and it works great. Good browser support and it handles touch events for mobile devices as well.
The appearance of the scrollbars is handled with a sprite that's pretty easy to customize. It's 17.5KB which comes out to about 8KB when it's compressed so it's nice not having the overhead of a whole library when this is all you want.
http://www.hesido.com/web.php?page=customscrollbar

Choppy/glitchy CSS3 transitions problem on the iPad 1 (with example)?

With this project at work, we have had to make a iPad HTML5. Using Backbone and jQuery Mobile, we thought we were on to a winner, but jQuery Mobile seems to be causing more problems than it should be. Using such things as page transitions with jQuery Mobile is painfully slow, choppy and glitchy (I do understand it's still in Alpha).
For our needs, we do want a smooth way of transitions between pages. I set about doing some experiments to see if I could get them any better for bespoke solution. I feel I'm quite close with this, but the animations still seem choppy and glitchy. I wonder if there is any other way to approach this? Or if there is a nugget of information that will help getting this rock solid?
I'm using translateX()/translateY() CSS3 (hardware accelerated) transforms to ensure it gets the best performance, but it still seems unreliable with it's performance. Sometimes it's ok, sometimes it's not.
I have uploaded an example... Please note, this is only tested in Chrome/Safari (which it looks fine in) and Mobile Safari on the iPad 1st generation (which it looks choppy in). If you happen to have an iPad handy, please take a look at this example...
http://littlejim.co.uk/code/ipad/jquery-plugin-page-transitions/
It's made as a basic plugin, because once I have this nailed I want to develop it more.
Can anyone help with this? I just wonder why it's still choppy on the iPad?
UPDATE: I tried using translate3d() as well as the translateX and translateY(), made no difference.
Only 3 dimensional transforms are hardware accelerated on the iPad. You should use translate3d and provide a 3rd parameter, set to zero.
http://googlecode.blogspot.com/2010/08/css3-transitions-and-transforms-in.html

Categories