Compatible with Mithril 1.0 and higher.
MIT
Content slider for Mithril for mobile and desktop
Compatible with Mithril 1.0 and higher.
MIT
Hey this is really awesome, am just having a play around with this.
My use-case is to have a carousel of pages to cycle through (not sure if this is the most effective widget for this...!) but I notice that the touch area for swiping occupies the entire div - is there an option to turn this off? Just wanted to check before starting to play around with the internals...
I'm getting an immediate crash when I try to use a Promise for pageData:
pageData: ()=>Promise.resolve([1,2,3,4]),
It starts out with a list.then()
, which is fine, but later accesses the Promise illegally with list(). The only way to get data from a promise is with promise.then(). Not sure how that can ever work (except that presumably m.request() supports a call?).
Is it possible for this slider component to be configured to operate like a carousel? Meaning, with n amount of previous and next slides/pages either side of the centre aligned current slide/page.
Example, https://owlcarousel2.github.io/OwlCarousel2/demos/basic.html
Seems in newer mithril versions one may not assign vnode.state.
The assignment here:
I'm getting double scroll events in Chrome - it looks like an extra set of pointercancel, pointermove and pointerup events are being attached. It doesn't happen every time, and I suspect a timing issue based upon how long the slider takes to render. If the slider is switched out and in again on a redraw of the view, more handlers are added.
Here's as stripped-down as I can get the issue. Because it's much simpler, the bug manifests less often, but in more complex code it happens every time.
https://gist.github.com/JohnAnthony/32dc028af0098a1d64adc388b3e3dc25
i figured to make it responssive by changing width values from px
to vw
const posPx = (i - 1) * 100 + 'vw';
and few other style declarations, got modified this way.
the problem is with .content wraper's width that doesn't get updated (based on it's content)
anyway i managed to fix this, the following way:
i call m.redraw()
in the view, at window resize event
window.addEventListener("resize", function(e) {
m.redraw() //notify view
})
is this ok, or there's a more elegant way to do it ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.