Wednesday, 15 June 2011

javascript - In HTML5 how do you make spefic video players pop up as a result of dropping and dragging spefic images into a div? -


I can drag and drop images into a div. I have 2 images, my problem is that I want to say "Image 1" when image 1 "carrot .jpg" is drawn and dropped into a video for a video, and when the image 2 "paper page" is drawn and To play "Divy" 2 "I would like to show the video in the pop-up window How do I do this? I have some code to display here how I am dropping and dragging events.

  

I think "showing in the pop-up window", you mean " Pop up in the same window ", because genuine pop-ups are upset, everyone hates them, and often block them from browsers.

You can start from the beginning in your HTML document, but hidden, using "display = none" in the CSS. In your drop (EV) function, then show one of your videos:

  if (data == 'drag1') var video = document.getElementById ( 'Video1'); Other video = document.getElementById ('video2'); Video.style.display = 'block'; Video.play ();  

Or, instead of the statement , you can change the ID of the drag source into the ID of the video, if you call them the same number:

  var video = document.getElementById ('video' + data. Slice (-1))  

Or maybe you have a video wrapped upright. To provide a frame with a divided divis or something, that would be the element with the frame "display = none" in that condition.


No comments:

Post a Comment