Comments (3)
#toolbar {
position: absolute;
top: 0;
right: 0;
left: 0;
width: auto;
height: 50px;
}
#content {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
margin-top: 51px;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
}
from snap.js.
I originally had my toolbar within .snap-content (the way that the demo is setup), then it drags/slides with the content, but that caused it to not be locked to the viewport, only locked within the scrollable .snap-content. To have a fixed toolbar you need to place the toolbar outside of .snap-content in the code and apply position: fixed to it.
Then you will have a fixed toolbar, but it won't animate/drag then. If you don't plan on using the drag functionality and only start SnapJS on button click, then animate the toolbar to slide (css transform) for the event hook, ex.- .on('start').
from snap.js.
Easy fix, simply add another instance of the Snap object, for example:
var snapper = new Snap({
element: document.getElementById('content')
});
var snapper2 = new Snap({
element: document.getElementById('snap_head')
});
from snap.js.
Related Issues (20)
- how to fixed this bug ?
- Is there a NPM module available for Snap.js ? HOT 4
- heading having issue being fixed positioning in ie10. HOT 1
- tapToClose does not prevent the menu from being close when set to 'false'
- Broken on Chrome's devtools mobile device emulator HOT 1
- How to work with bootstrap 3 ? HOT 1
- Keep content size while snapping
- How to have menu open on page load? HOT 1
- "dir = rtl " breaks the right drawer? HOT 1
- Snap is not closing in Windows 10, Browser ie11
- snapper.trigger('start');
- New Maintainers HOT 1
- Adding bootstrap dropdown box
- Jumpping bug in modal when button have position: relative
- Demo breaks if you move over the sidebar
- How do I prevent triggering menu open when scrolling on certain element. HOT 1
- Is this going to be updated? HOT 4
- Disable dragging effect on desktop HOT 1
- Make sticky?
- Is it a typo ? shelfs versus shelves
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snap.js.