Comments (1)
I fixed it, for anyone who would like to know how. This is how I did it.
var audio1 = document.getElementById("audio1");
var audio2 = document.getElementById("audio2");
var audio3 = document.getElementById("audio3");
var audio4 = document.getElementById("audio4");
var player1 = document.getElementById("article-video1");
var player2 = document.getElementById("article-video2");
var player3 = document.getElementById("article-video3");
var player4 = document.getElementById("article-video-2");
var player5 = document.getElementById("article-video-3");
function playMary() {
audio1.play();
}
function playNancy() {
audio2.play();
}
function playJames() {
audio3.play();
}
function playJohn() {
audio4.play();
}
$(document).on('click.modal', 'a[rel~="modal:open"]', function(event) {
player1.play(); // Stop playing
player2.play(); // Stop playing
player3.play(); // Stop playing
player4.play(); // Stop playing
player5.play(); // Stop playing
});
$(document).on('click.modal', 'a[rel~="modal:close"]', function(event) {
if (audio1) {
audio1.pause(); // Stop playing
audio1.currentTime = 0; // Reset time,
} else if(audio2){
audio2.pause(); // Stop playing
audio2.currentTime = 0; // Reset time
} else if(audio3){
audio3.pause(); // Stop playing
audio3.currentTime = 0; // Reset time
} else if(audio4) {
audio4.pause(); // Stop playing
audio4.currentTime = 0; // Reset time
} else if (myPlayer){
myPlayer.pause(); // Stop playing
myPlayer.currentTime = 0; // Reset time
}
player1.pause(); // Stop playing
player2.pause(); // Stop playing
player3.pause(); // Stop playing
player4.pause(); // Stop playing
player5.pause(); // Stop playing
console.log(myPlayer);
});
from jquery-modal.
Related Issues (20)
- Scroll Issue with HTML Page in Modal Window
- Is there something like 'CATCH-ALL' for the events? HOT 5
- browser crash due to memory usage on modal
- Incompatable with Bootstrap HOT 5
- Can't remove the close link and unable to use transitions
- why it include scss HOT 1
- How to open url ajax modal on pageload?
- Manually prevent modal close
- fix conflict with bootstrap modal class
- jquery-modal not displaying HOT 2
- Can CORS issue block div from Displaying on the screen?
- AJAX loaded modal not being removed from DOM on close
- mouseUp on overlay is closing modal
- Screen auto scrolls up on link click HOT 2
- Close a specific modal popup, by providing the element Id HOT 1
- Trouble Displaying an iFrame HOT 6
- BEFORE_CLOSE Event doesnt seem to fire? Want to stop iframe on modal close
- Events inside Jquery Modal not working when call modal('show') method
- Multiple imports of jquery modal HOT 1
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 jquery-modal.