Styling of on-page scroll bars - javascript

I am working on a site to the specification of a designer who loves to put styled scroll bars on the page (not the main scroll bar on the right, but for various fixed-height divs on the page, when the content overflows).
I'm not asking if this practice is "right" or not, and I know it's generally accepted to be a bad idea in terms of user-experience, but that doesn't change what the client is now expecting to see on their site.
Does anyone know of any relatively bug free, cross browser methods for doing this. Examples I've seen so far include Skinned HTML Scrollbar, Ajaxian Webkit, and jScrollPane, but I'd like to hear from anyone who has achieved this functionality in the past before I implement one of these.
Thanks in advance.

I've used jQuery in the past when a client and their designer insisted in having customised scroll-bars. It's quite easy to stick a div on the side of a box and make it draggable between limits (and interpret the position to set the scroll offset).
But you also have to consider what happens if they want to scroll using the mousewheel, or middle-click. They're not blockers but you'll have to write listeners to update the scroll-bar position too.
Whether or not you should do it is a completely different question. You should certainly not just rely on your custom JS. Make the JS disable the scrollbar and paint all your controls using JS. If you don't do this, people with JS disabled/blocked won't be able to use your site.

Related

Laggy jittery user experience when updating top/bottom value using javascript scroll event

I am trying out this new implementation where I am updating some div's bottom/top value to emulate fixed position using javascript with scroll event. The problem is while scrolling the div's are getting a fixed position but moving little bit up/down depending on scroll direction. Had to do it this way as I used transform scale. So CSS position fixed doesn't work. Any optimization advice will be very helpful.
the code is here --> Alternative of position fixed using JavaScript shows weird behavior on window resize
If you check my page on desktop/laptop you can experience that. It depends on a lot of variables like how powerful the device is, browser to browser. I am hoping that if anyone has access to MAC OS on safari and chrome or Windows chrome or any desktop/laptop with a decent browser on it may check the user experience and leave a comment about how laggy jittery is it? Is it like okay or bad?
the webpage link --> https://elomymelo.com/soundcore-motion-boom-plus.html
All you need to do is, scroll down half of my page clicking the link above on desktop/laptop. The right side content should get fixed. But may have jittery behavior on scroll. And please leave a comment about how bad is the experience?
Thanks for your time. This will help me a lot to figure out if I should implement it on the other pages or not. Any optimization advice will be very helpful.

Chat like scroll behaviour (ReactJs)

I am trying to implement a chat application, more precisely a scroll behavior for chat application. I think it's best described with a gif.
https://i.imgur.com/NnpMeOx.gif
As you can see, I want to support a few key features:
Scrolling is reversed so on page load, the messages start on the bottom along with the scrollbar
Chat is scrolled to the bottom when user types in a message. (this is easy, no need to pay attention to this part)
If new messages appears (pushed by websocket in real life) it shouldn't disrupt the existing scroll position, unless it's already at the bottom. Then it should scroll to reveal the message automatically.
So far I've implemented 2 solutions:
a) Display flex and flex-direction column-reverse on the scrollable element. This works beautifully out of a box, but only on chrome :( IE (and Edge) as well as firefox just ignores this totally. NOT A GOOD SOLUTION
b) I flipped the container with transform: scaleY(-1) then I reversed the messages and fliped every one of those with the same transform. The main obvious problem here is the scroll (mouse wheel and arrows) is reversed. I sort of fixed it, didn't manage smooth scroll (sucks) but yet again, Edge (and probably IE) just shows scrollbar as disabled. NOT A GOOD SOLUTION
I am really hoping to find somebody who can point me in the right direction because so far, my efforts while logically ok totally failed browser compatibility.
The code is on https://github.com/PeterKottas/react-bell-chat, it's react but tbh, that doesn't matter much as this seems more like a general web dev exercise.
P.S.: I can't use jQuery, hope that's fair. So either css or plain javascript. Like I've said, this doesn't have much to do with react
Well I got no replies and managed to fix it myself so I'll accept this in case it helps somebody in the future.
3rd and final solution:
I kept the direction of scrolling and didn't do any reversing at all. Instead I hooked into onScroll and wheel event, created a few callbacks and managed to mimic the behavior perfectly. You can find more details in the code on https://github.com/PeterKottas/react-bell-chat.

How to make scrolling smoother (not anchor links, just scrolling in general)

So I am working on a website about myself, because I want to become a freelancer some day and make websites for clients. I thought something like smooth scrolling would make the site look much cooler. I have looked at multiple jQuery plugins online, but they do not seem to give me the smooth animation I want.
DEMONSTRATION OF SMOOTH SCROLL I WANT -> http://bayshoresolutions.com
Please do not rate negatively unless you have left a comment telling me why so I can fix my post
I was able to find one by searching section scroll. Just to let you know this is considered bad UX design by many. Check out here: https://ux.stackexchange.com/questions/81721/is-using-pages-section-scrolling-good-for-ux
https://github.com/alvarotrigo/fullPage.js
http://alvarotrigo.com/fullPage/

Smooth vertical page scrolling using mouse wheel and scroll bar

I am playing around and trying to build a parallax website - yes, I know they are an annoying fad but I would still like to have a go. So, for inspiration, I have been looking at various examples of good parallax websites and came across this one: https://victoriabeckham.landrover.com/INT.
It has smooth scrolling using the mouse wheel, scrollbar, and anchor links. I have been searching for jQuery plugins that would achieve this effect but can only seem to find ones that use internal page links - anchor or ID's (detailed below) - but, not mouse wheel and scrollbar. There is a good chance that I am searching using the wrong keywords. Does anyone know the correct terminology to find these plugins or know any plugins that would achieve this effect?
On a side note, I am currently learning jQuery and Javascript but am in the very early stages - still trawling through codeacademy and not made it onto any real world code yet. So at the moment I am playing with plugins as a way of learning but hopefully in a few months I can build my own stuff!
Smooth scrolling to anchor tags or ID's:
http://archive.plugins.jquery.com/project/ScrollTo
http://jsfiddle.net/9Amdx/7/
http://arthurclemens.github.com/jquery-page-scroll-plugin/
http://www.learningjquery.com/2007/09/animated-scrolling-with-jquery-12
http://www.designova.net/scrollerbird/
http://chris-spittles.co.uk/?p=462
http://joelb.me/scrollpath/ (*courtesy of #DrunkRocketeer)
And, another example of a parallax website using a similar technique for scrolling:
http://www.ascensionlatorre.com
Try this one. https://nicescroll.areaaperta.com/
It has got
$().scrollTop()
jQuery event listener too so you can have scroll path configured with parallax script.
I think you have to combine several of these effects in order to make something that resembles the Landrover site. A Smooth scroll script, a scroll path script and a parallax script.
This is an interesting site for the path element of that website:
http://joelb.me/scrollpath/
Though the best way to find out how these sites work is to examine them! Some cool sites useing parallax:
http://www.awwwards.com/?s=parallax&post_type=all&search=Ok
I hope this was of some help/inspiration!

JavaScript Background Perspective Library

I remember seeing this on Ajaxian and a couple other sites but I never bookmarked it, now i can't find it again. It's a javascript library that allows you to move your mouse over an image that's been chopped into layers and change perspective. Any links would be appreciated.
Are you talking about parallax scrolling?
http://webdev.stephband.info/parallax.html

Categories