Coffeebuzz Posted October 28, 2017 Share Posted October 28, 2017 does anyone have experience with creating a "snackbar?" i would like it to completely cover the bottom of the page. how do i set the margins and padding to work on a desktop and mobile viewport? thanks. Link to comment Share on other sites More sharing options...
Ingolme Posted October 28, 2017 Share Posted October 28, 2017 I'm not familiar with the term "snackbar" in the context of web development. Could you describe what it is? Link to comment Share on other sites More sharing options...
Coffeebuzz Posted October 29, 2017 Author Share Posted October 29, 2017 You can find the example of it on the w3schools site. https://www.w3schools.com/howto/howto_js_snackbar.asp a pop up overlay would be similar, is there an easy way to create that effect? Link to comment Share on other sites More sharing options...
Ingolme Posted October 29, 2017 Share Posted October 29, 2017 Set the bottom to zero, left to zero and width to 100%. For the animation frames, instead of going from 0 to 30px, make it go from -30px to 0. I modified the example: https://www.w3schools.com/code/tryit.asp?filename=FKZOXM2O3JB1 Link to comment Share on other sites More sharing options...
Coffeebuzz Posted October 31, 2017 Author Share Posted October 31, 2017 that was exactly the effect i was looking for, thank you! do you know if i can add a graphic or image inside the "snackbar?" also, how do i download or copy all the source files and rename them so they link directly to my servers? thanks in advance :-) Link to comment Share on other sites More sharing options...
Ingolme Posted October 31, 2017 Share Posted October 31, 2017 You can put anything you want in the snackbar. I'm not sure what your files you're referring to, all the code is right there in the example and not being loaded from an external file. Learn how the code works so that you can build it on your own. Link to comment Share on other sites More sharing options...
Coffeebuzz Posted November 2, 2017 Author Share Posted November 2, 2017 ok got it. thank you very much Link to comment Share on other sites More sharing options...
Coffeebuzz Posted November 7, 2017 Author Share Posted November 7, 2017 do you know if i can load the snackbar automatically without having to click on a button and have it appear for a certain time period, like 10 seconds then fade away? or is it possible to add a close icon ( x ) to it so the site visitor can close it when they want? thanks Link to comment Share on other sites More sharing options...
Ingolme Posted November 8, 2017 Share Posted November 8, 2017 If you learn a bit more Javascript, you can do any of that. You'll need to learn about event listeners and timing. I believe all of it is covered in the W3Schools tutorials. Link to comment Share on other sites More sharing options...
Coffeebuzz Posted November 8, 2017 Author Share Posted November 8, 2017 Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now