Comments (7)
Solution path:
add in src/js/libs/utils/utils.js
export function initModals() {
let targets = document.querySelectorAll(".modal-trigger");
if (typeof targets != "undefined" && targets != null) {
for (var i = 0, len = targets.length; i < len; i++) {
targets[i].addEventListener('click', function (event) {
console.log('click modal');
var modalID = this.getAttribute('data-modal');
document.querySelector('#' + modalID).classList.add('is-active');
})
}
}
targets = document.querySelectorAll(".modal-close");
if (typeof targets != "undefined" && targets != null) {
for (var i = 0, len = targets.length; i < len; i++) {
targets[i].addEventListener('click', function (event) {
console.log('click modal close');
this.closest('.modal').classList.remove('is-active');
})
}
}
}
in js/main.js
- add initModals in import from ulils.js
- add in document.onreadystatechange = function () {
...
const modals = initModals();
Enjoy)
from fresh.
Hi, thanks for this contribution. Would you be kind to submit it as a PR? I'll review it and merge it then. Thanks!
from fresh.
There are still problems there:
- navbar will overlap the close button
- in modal mode, the backtotop button is again visible and active
- scrolling continues when the modal is open
I do not yet have a solution to these questions, but I continue to think about it.
from fresh.
You can submit the PR as is and I can fix the remaining points you shared.
from fresh.
Add PR #26
from fresh.
Thanks for your PR. I also made some changes to include what you've asked for. Please test and close the issue if you're ok with it.
from fresh.
Thank you very much! Everything works as it should.
from fresh.
Related Issues (15)
- Remove panelSlider plugin HOT 1
- Gulp build not working HOT 2
- TypeError: Cannot read property 'apply' of undefined HOT 3
- Please, Upgrate bulma HOT 1
- SASS compiling not working? HOT 1
- Please, add bulma dependence from the NPM. HOT 2
- [Feature]: Add more than three testimonials
- social icons in footer should be links HOT 1
- [Feature]: Add a login page HOT 1
- [Performance]: Extremely slow
- font-awesome is outdated HOT 4
- modals HOT 2
- Demo page: image pulled up too high, covering elements before it HOT 6
- what is this code for? HOT 2
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 fresh.