This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var youtube_video = $('iframe'); | |
var url = youtube_video.attr('src'); // 1. First get the iframe URL | |
youtube_video.attr('src', ''); // 2. Then assign the src to null, this then stops the video been playing | |
youtube_video.attr('src', url); // If you need to reassign the URL back to your iframe, so when you hide and load it again you still have the link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]--> | |
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 判斷按下的按鈕是哪一個 | |
* @param (event) e keypress event. | |
* @param (mix) targetKeyChar 按鍵的編號或名稱,如果是這個按鍵,就執行 callback | |
* @param (function) callBack 送入callback的function,不用加()括號 | |
* | |
*/ | |
var detectKeyPress = function(e, targetKeyChar, callBack){ | |
var keynum |