最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Camera slideshow v1.3.3 - adjust the image size - Stack Overflow

programmeradmin6浏览0评论

I want to create the slideshow of pany labels that are of a certain size. I use the script camera.js to create the slideshow and I need to change the image size:

<link 
    rel='stylesheet' 
    id='camera-css'  
    href='/html/themes/classic/css/camera.css' 
    type='text/css' media='all'> 

<style>
    .fluid_container {
        margin: 0 auto;
        max-width: 1000px;
        width: 100%;
    }
</style>

<script>
    jQuery(function(){
        jQuery('#camera_wrap_3').camera({
            height: '50%',
            pagination: true,
            thumbnails: false,
            imagePath: '/html/themes/classic/images/'
        });
    });
</script>

<div class="fluid_container">
    <div 
        class="camera_wrap camera_emboss" 
        id="camera_wrap_3">
        <div 
            data-thumb="/thumbs/1.jpg" 
            data-src="/slides/1.jpg" 
            data-time="1500" 
            data-trasPeriod="4000" 
            data-link="some link here" 
            data-target="_blank">
                <div 
                    class="camera_caption fadeFromBottom">
                some text here
                </div>
        </div>
        <div 
            data-thumb="/thumbs/2.jpg" 
            data-src="/slides/2.jpg" 
            data-time="1500" 
            data-trasPeriod="4000" 
            data-link="some link here" 
            data-target="_blank">
                <div 
                    class="camera_caption fadeFromBottom">
                some text here
                </div>
        </div>
    </div>
</div>

<div style="clear:both; display:block; height:100px"></div>

Here are some screenshots.

For max-width == 400px:

For max-width == 100px:

How to change the size? I need a smaller container and slides should be 310x82.

I want to create the slideshow of pany labels that are of a certain size. I use the script camera.js to create the slideshow and I need to change the image size:

<link 
    rel='stylesheet' 
    id='camera-css'  
    href='/html/themes/classic/css/camera.css' 
    type='text/css' media='all'> 

<style>
    .fluid_container {
        margin: 0 auto;
        max-width: 1000px;
        width: 100%;
    }
</style>

<script>
    jQuery(function(){
        jQuery('#camera_wrap_3').camera({
            height: '50%',
            pagination: true,
            thumbnails: false,
            imagePath: '/html/themes/classic/images/'
        });
    });
</script>

<div class="fluid_container">
    <div 
        class="camera_wrap camera_emboss" 
        id="camera_wrap_3">
        <div 
            data-thumb="/thumbs/1.jpg" 
            data-src="/slides/1.jpg" 
            data-time="1500" 
            data-trasPeriod="4000" 
            data-link="some link here" 
            data-target="_blank">
                <div 
                    class="camera_caption fadeFromBottom">
                some text here
                </div>
        </div>
        <div 
            data-thumb="/thumbs/2.jpg" 
            data-src="/slides/2.jpg" 
            data-time="1500" 
            data-trasPeriod="4000" 
            data-link="some link here" 
            data-target="_blank">
                <div 
                    class="camera_caption fadeFromBottom">
                some text here
                </div>
        </div>
    </div>
</div>

<div style="clear:both; display:block; height:100px"></div>

Here are some screenshots.

For max-width == 400px:

For max-width == 100px:

How to change the size? I need a smaller container and slides should be 310x82.

Share Improve this question edited Sep 22, 2019 at 6:15 asked Dec 3, 2012 at 16:11 user1134181user1134181
Add a ment  | 

3 Answers 3

Reset to default 2

You can adjust the height like so

        jQuery(function(){

            jQuery('#camera_wrap_3').camera({
                **height: '82px',**
                pagination: true,
                thumbnails: false,
                imagePath: '/html/themes/classic/images/'
            });

        });

However, I've been unable to affect any change on width.

jQuery(function () {
            jQuery('#camera_wrap_1').camera({
                alignment: 'center',
                maxHeight: $('.slider').outerHeight()+"px",
                thumbnails: true
            });
        });

You can calculate with outerHeight function.

in the version of camera that came with a theme my client bought, there was another tweak in addition to passing the height into the initializer i had to override this style as it had a min-height of 500px which made it impossible to make it the height I needed.

.camera_fakehover {
    min-height:50px;
}
发布评论

评论列表(0)

  1. 暂无评论