Supersized: playToggle

折月煮酒 提交于 2019-12-12 04:09:48

问题


I am using the Supersized background slideshow:

http://buildinternet.com/project/supersized/

with the following code to pause the Slideshow while loading a modal box.

Jquery

<script type="text/javascript">
$(function($) {
 $('#slideInfo').click(function() {
    api.playToggle();
  });
});

</script>

HTML

<div id="btnContainer">
<a id="slideInfo" href="#">More Info</a>
</div>

I am able to pause the slideshow. However, when I close the modal box the Slideshow won't play back again (it stays paused).

Is there a way to accomplish this?

Thanks!

EDIT:

Here's the test site:

http://clientes.ktulumedia.com/peppophotography.com

And the relevant code:

 <script type="text/javascript">
 $(function($) {
 $('#slideInfoplay').click(function() {
 api.playToggle();
 });
 });


 $(function($) {
 $('#sb-nav-close').click(function() {
 api.playToggle();
 });
 });

 </script>

Click where it says "test". I am able to open the modal box and pause the slideshow. However, when I close the modal box, I am unable to restart the slideshow.


回答1:


Your plugin usage is true but your jQuery document ready method is wrong.

$(function() {//you shouldnt use '$' inside function()
 $('#slideInfo').click(function() {
    api.playToggle();
  });
});

or

$(document).ready(function() {
 $('#slideInfo').click(function() {
    api.playToggle();
  });
});


来源:https://stackoverflow.com/questions/11541577/supersized-playtoggle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!