2015-02-09 91 views
1

这里是我的http://jsfiddle.net/j88u02o2/59/如何在我的幻灯片上设置iframe视频?

的滑块这是脚本:

$(function() { 
     $('#slides').crossSlide({ 
      speed: 40, 
      fade: 1 
     }, [ 
      { src: 'img/photo-2.jpg', dir: 'up', alt: 'Our Business is to Encrypt and Secure Your Communications', href: '#' }, 
      { src: 'img/photo-10.jpg', dir: 'down', alt: 'The Solution for Secured Communications and Privacy.', href: '#' }, 
      { src: 'img/photo-3.jpg', dir: 'up', alt: 'All Text and Phone Communications are Encrypted End-to-End.', href: '#' }, 
      { src: 'img/photo-4.jpg', dir: 'down', alt: 'Secured Communications for Law Enforcement and Public Officials.', href: '#' }, 
      { src: 'img/photo-5.jpg', dir: 'up', alt: 'Secured Communications for the U.S. Military.', href: '#' }, 
      { src: 'img/photo-6.jpg', dir: 'down', alt: 'The World Leader in Encrypted Communications.', href: '#' }, 
      { src: 'img/photo-7.jpg', dir: 'down', alt: 'The Solution for Corporate Executives, Law Enforcement, Homeland Security, Goverment Agencies and more...', href: '#' } 

     /* */ 
     ], function(idx, img, idxOut, imgOut) { 
      if (idxOut == undefined) { 
       if(idx == 0 || idx == 3 || idx == 6 || idx == 9){ 
        document.getElementById('crossSlideCaption').style.marginTop = '-425px'; 
        document.getElementById('crossSlideCaption').style.marginLeft = '-480px'; 
       }else if(idx == 1 || idx == 4 || idx == 7 || idx == 10 || idx == 12){ 
        document.getElementById('crossSlideCaption').style.marginTop = '-425px'; 
        document.getElementById('crossSlideCaption').style.marginLeft = '-480px'; 
       }else{ 
        document.getElementById('crossSlideCaption').style.marginTop = '-425px'; 
        document.getElementById('crossSlideCaption').style.marginLeft = '-480px'; 
       }; 
       $('div.caption').text(img.alt).animate({ opacity: 1.0 }) 
      } else { 
       //$('div.caption').animate({ opacity: 0 }) 
      }}); 
      $('div.caption').show().css({ opacity: 0 }) 
     }); 

现在一切工作正常,现在我需要的iframe视频像添加到我的幻灯片作为标题。

我的视频尺寸420x234像素,这是iframe的视频代码:

<iframe src="//fast.wistia.net/embed/iframe/bqur1fvyag?videoFoam=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="720" height="433"></iframe> 
<script src="//fast.wistia.net/assets/external/E-v1.js"></script> 

但我空白的我怎么能在我现有的代码添加。

任何人都可以帮助我实现这一目标吗?

在此先感谢。

+0

你们是不是要追加这个iframe来你的''#crossSlideCaption''?然后只需将'$('div.caption')。text(img.alt)'改为'$('div.caption')。html(img.alt)'并将代码粘贴到'alt'属性中,但我倒了这是一个有点奇怪的要求... – Kaiido 2015-02-09 11:51:24

+0

我需要标题以及iframe视频@Kaiido ..谢谢 – rish 2015-02-09 11:58:16

+0

@Kaiido:已经有标题在ALT属性权利?那么我如何在alt属性中添加