我可以将面板宽度设置为尾声滑块内图像的宽度吗?

我正在使用coda滑块创建一个网站,我想根据div中的图像宽度设置panelWidth。
$(".panel").each(function(){
                        var imageWidth = $(this).find("img").width()+1;
                        $(this).width(imageWidth);

                    });
有任何想法吗?     
已邀请:
解决问题的一种方法是修改coda滑块插件。我没有找到一个开箱即用的插件方式。这是一个粗略的方式来做你想要的,把它看作一个小灵感。我修改了
alterPanelHeight
功能,所以如果你设置
autoHeight
选项,它也会改变宽度。注意:修改不会改变加载宽度,第一次修改将在第一次滚动后发生...
    function alterPanelHeight(x) {
        if (settings.autoHeight) {
            newSliderWidth = $('.panel:eq('+x+')').find('img').width();
            panelHeight = $('.panel:eq(' + x + ')', slider).height()
            slider.animate({ height: panelHeight, width: newSliderWidth }, settings.autoHeightEaseDuration, settings.autoHeightEaseFunction);

        };
    };      
    

要回复问题请先登录注册