jquery flipbook - 不能在这里使用音频 [英] jquery flipbook - can not use audio here

查看:69
本文介绍了jquery flipbook - 不能在这里使用音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



http:// saptshati-rudra-sadhana .com / [ ^



在上面的链接中,每个分区都有一个音频,我的问题是,当页面翻转时,即当它可见时,音频应该播放,通过点击下一个或上一个按钮它应该是暂停另一个视频开始了。我尝试了很多但不能这样做:(你可以帮帮我吗?



这里是html代码:



Hello everyone ,

http://saptshati-rudra-sadhana.com/[^

In above link there is an audio in every division,My problem is that when the page flip i.e, when it visible , the audio should be play and by clicking next or previous button it should be pause and another video get started.I tried it a lot but can't do :( can u please help me out ?

here is the html code :

<!DOCTYPE html>
<html lang="en" class="no-js demo-2">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
		<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
		<title>Rudhyadhayi Sadhyay</title>
		<meta name="description" content="Bookblock: A Content Flip Plugin - Demo 2" />
		<meta name="keywords" content="javascript, jquery, plugin, css3, flip, page, 3d, booklet, book, 

perspective" />
		<meta name="author" content="Codrops" />
		<link rel="shortcut icon" href="../favicon.ico"> 
		<link rel="stylesheet" type="text/css" href="css/default.css" />
		<link rel="stylesheet" type="text/css" href="css/bookblock.css" />
		<!-- custom demo style -->
		<link rel="stylesheet" type="text/css" href="css/demo2.css" />
		<link rel="stylesheet" type="text/css" href="css/calendar.css" />
		<script src="js/modernizr.custom.js"></script>

<script type="text/javascript">
 $(document).ready(function(){

if ($('.bb-item').style.display = 'block') {

    $('audio').each(function() {
        $(this).play();
    });

} else {

    $('audio').each(function() {
        $(this).pause();
    });


}
});
</script>
 <script>

      function doStuff()
      {
        var nameElement = document.getElementById("someInput");
        var theName = nameElement.value;
     <!--    document.getElementById("someDiv").innerHTML = theName; -->
		window.location.href="#"+theName;
      }

  </script>
	</head>

	<body>
		<div class="container">
			<!-- Top Navigation -->
			<header style="display:inline;">
				<img src="images/1.png" alt="sadhana" style="position: relative;
left: 261px;
top: 31px"/>
				<nav class="codrops-demos" style="font-size: 1.2em;<br mode=" hold=" />position: relative;<br mode=">
					
					<a class="current-demo" href="index.html">Home</a>   | 
					<a href="aboutus.html">About Us</a>   | 					

<a href="contactus.html">Contact Us</a>
				</nav>
			</header>
			<div class="main clearfix">
				<div class="bb-custom-wrapper">
					<div id="bb-bookblock" class="bb-bookblock">
						<div class="bb-item" id="1">
						 	<img src="img/b1.jpg" alt="1"> 
							<br /> <br />
							<audio src="img/004_Joduniya Kar Charni_128kbps.mp3" controls="">
<p>If you are reading this, it is because your browser does not support the audio element.</p>
</audio>
						</div>
						<div class="bb-item" id="2">

<img src="img/b2.jpg">		
<br /> <br />
							<audio src="img/004_Joduniya Kar Charni_128kbps.mp3" controls="">
<p>If you are reading this, it is because your browser does not support the audio element.</p>
</audio>				
						</div>
										<div class="bb-item" id="3">
							
<img src="img/b3.jpg">			<br /> <br />
							<audio src="img/004_Joduniya Kar Charni_128kbps.mp3" controls="">
<p>If you are reading this, it is because your browser does not support the audio element.</p>
</audio>			
						</div>
						<div class="bb-item" id="4">
							
<img src="img/b4.jpg">			<br /> <br />
							<audio src="img/004_Joduniya Kar Charni_128kbps.mp3" controls="">
<p>If you are reading this, it is because your browser does not support the audio element.</p>
</audio>			
													</div>
						<div class="bb-item" id="5">
				
<img src="img/b5.jpg">		<br /> <br />
							<audio src="img/004_Joduniya Kar Charni_128kbps.mp3" controls="">
<p>If you are reading this, it is because your browser does not support the audio element.</p>
</audio>				
								</div>
						<div class="bb-item" id="6">

<img src="img/b6.jpg">		<br /> <br />
							<audio src="img/004_Joduniya Kar Charni_128kbps.mp3" controls="">
<p>If you are reading this, it is because your browser does not support the audio element.</p>
</audio>									
						</div>
						<div class="bb-item" id="7">
				
<img src="img/b7.jpg">		<br /> <br />
							<audio src="img/004_Joduniya Kar Charni_128kbps.mp3" controls="">
<p>If you are reading this, it is because your browser does not support the audio element.</p>
</audio>					
						</div>
						<div class="bb-item" id="8">
						
<img src="img/b8.jpg">		<br /> <br />
							<audio src="img/004_Joduniya Kar Charni_128kbps.mp3" controls="">
<p>If you are reading this, it is because your browser does not support the audio element.</p>
</audio>				
							
						</div>
				
					</div> 
					
						<a id="bb-nav-prev">
 href="#" style="removed: absolute;
removed -79px;
removed 251px;" ><img src="images/pb.png"></a>
						<a id="bb-nav-next" style="removed: absolute;<br mode=" hold=" />top: 251px;<br mode=">

<img src="images/nb.png"></a>

<div style="margin-removed 50px;<br mode=" hold=" />">   
             <span>Enter Page No.</span>            <input id="someInput" type="text" size="3">
  <input type="button" value="Say Hello"  önClick="doStuff()" style="background: url(images/go.png);
height: 51px;
width: 70px;
border: none;
font-size: x-small;
color: rgb(255, 255, 255);
font-size: 1px">
 
<br /><br />  </div>

					
				</div>
			</div>
		</div><!-- /container -->
		<script src="js/jquery.min.js" ></script>
		<script src="js/jquery.bookblock.js"></script>
		<script>
			var Page = (function() {
				
				var config = {
						$bookBlock : $( '#bb-bookblock' ),
						$navNext : $( '#bb-nav-next' ),
						$navPrev : $( '#bb-nav-prev' )
					},
					init = function() {
						config.$bookBlock.bookblock( {
							orientation : 'horizontal',
							speed : 700
						} );
						initEvents();
					},
					initEvents = function() {

						var $slides = config.$bookBlock.children();
						
						// add navigation events
						config.$navNext.on( 'click touchstart', function() {
							config.$bookBlock.bookblock( 'next' );
							return false;
						} );

						config.$navPrev.on( 'click touchstart', function() {
							config.$bookBlock.bookblock( 'prev' );
							return false;
						} );

						// add keyboard events
						$( document ).keydown( function(e) {
							var keyCode = e.keyCode || e.which,
								arrow = {
									left : 37,
									up : 38,
									right : 39,
									down : 40
								};

							switch (keyCode) {
								case arrow.up:
									config.$bookBlock.bookblock( 'prev' );
									e.preventDefault();
									break;
								case arrow.down:
									config.$bookBlock.bookblock( 'next' );
									e.preventDefault();
									break;
							}

						} );
					};

					return { init : init };

			})();
		</script>
		<script>
				Page.init();
		</script>
	</body>
</html>





and here is the jquery :



http://saptshati-rudra-sadhana.com/js/modernizr.custom.js

推荐答案

(document).ready(function(){

if (
(document).ready(function(){ if (


('.bb-item').style.display = 'block') {
('.bb-item').style.display = 'block') {


('audio').each(function() {
('audio').each(function() {


这篇关于jquery flipbook - 不能在这里使用音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆