jQuery插件设置高度错误

时间:2022-08-23 23:53:27

Strange issue, I've used jQuery Coda Slider 2 for many projects now but it's behaving strangely on this one. I don't have any javascript errors being reported on the page and the script is loading because you can see the page load normally and then animate when the plugin kicks in. For some reason, the javascript is dynamically adding style="height: 0 to the .coda-slider element (a standard portion of the code generated by the plugin).

奇怪的是,我现在已经在许多项目中使用了jQuery Coda Slider 2,但它在这个上表现得很奇怪。我没有在页面上报告任何javascript错误并且脚本正在加载,因为您可以正常看到页面加载,然后在插件启动时设置动画。出于某种原因,javascript动态添加style =“height:0到.coda-slider元素(由插件生成的代码的标准部分)。

Due to the complexity of the code and plugin, it's probably best to just look at the live production version of the site here (watch for the video to load correctly and then disappear when the plugin sets their height to zero for some mysterious reason):

由于代码和插件的复杂性,最好只在这里查看网站的实时制作版本(观看视频正确加载,然后当插件将其高度设置为零时因某些神秘原因而消失):

http://valeriaentertainment.com.s66112.gridserver.com/gallery/video-gallery/

http://valeriaentertainment.com.s66112.gridserver.com/gallery/video-gallery/

1 个解决方案

#1


1  

Ok i've checked how coda-slider plugin works. It seems to give the height according to the '.panel' height which you actually dont have. Just add "class='panel'" to your

好的,我已经检查了coda-slider插件的工作原理。它似乎根据你实际上没有的'.panel'高度来给出高度。只需将“class ='panel'”添加到您的

  • . Something like:

    <div class="coda-slider-wrapper"> 
                    <ul class="coda-slider preload" id="home_slider"> 
                        <li class='panel'><iframe src="http://player.vimeo.com/video/12477617?title=0&amp;byline=0&amp;portrait=0" width="620" height="411" frameborder="0"></iframe><br class="clear" /></li> 
                        <li class='panel'><iframe title="YouTube video player" width="620" height="379" src="http://www.youtube.com/embed/PnE14vUkEtc" frameborder="0" allowfullscreen></iframe><br class="clear" /></li> 
                    </ul> 
                </div> 
    

    Enjoy.

    请享用。

  • #1


    1  

    Ok i've checked how coda-slider plugin works. It seems to give the height according to the '.panel' height which you actually dont have. Just add "class='panel'" to your

    好的,我已经检查了coda-slider插件的工作原理。它似乎根据你实际上没有的'.panel'高度来给出高度。只需将“class ='panel'”添加到您的

  • . Something like:

    <div class="coda-slider-wrapper"> 
                    <ul class="coda-slider preload" id="home_slider"> 
                        <li class='panel'><iframe src="http://player.vimeo.com/video/12477617?title=0&amp;byline=0&amp;portrait=0" width="620" height="411" frameborder="0"></iframe><br class="clear" /></li> 
                        <li class='panel'><iframe title="YouTube video player" width="620" height="379" src="http://www.youtube.com/embed/PnE14vUkEtc" frameborder="0" allowfullscreen></iframe><br class="clear" /></li> 
                    </ul> 
                </div> 
    

    Enjoy.

    请享用。