Home Forums WoodMart support forum 360view speed

360view speed

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #466318

    uitomatengoed.nl
    Participant

    Hi,
    Great theme! It’s great!

    Q: Speed of the 360 image view, how can i reduce it? I add this code in my child theme/functions.php but it still is not smooth:
    function basel_product_360_view() {
    $images = basel_get_360_gallery_attachment_ids();
    if( empty( $images ) ) return;

    $id = rand(100,999);

    $title = ”;

    $frames_count = count( $images );

    $images_js_string = ”;

    ?>
    <div class=”product-360-button”>
    <span><?php _e(‘360 product view’, ‘basel’); ?></span>
    </div>
    <div id=”product-360-view” class=”product-360-view-wrapper mfp-hide”>
    <div class=”basel-threed-view threed-id-<?php echo esc_attr( $id ); ?>”>
    <?php if ( ! empty( $title ) ): ?>
    <h3 class=”threed-title”><span><?php echo ($title); ?></span></h3>
    <?php endif ?>
    <ul class=”threed-view-images”>
    <?php if ( count($images) > 0 ): ?>
    <?php $i=0; foreach ($images as $img_id): $i++; ?>
    <?php
    $img = wp_get_attachment_image_src( $img_id, ‘full’ );
    $width = $img[1];
    $height = $img[2];
    $images_js_string .= “‘” . $img[0] . “‘”;
    if( $i < $frames_count ) {
    $images_js_string .= “,”;
    }
    ?>
    <?php endforeach ?>
    <?php endif ?>

    <div class=”spinner”>
    <span>0%</span>
    </div>
    </div>
    <script type=”text/javascript”>
    jQuery(document).ready(function( $ ) {
    $(‘.threed-id-<?php echo esc_attr( $id ); ?>’).ThreeSixty({
    totalFrames: <?php echo $frames_count; ?>,
    endFrame: <?php echo $frames_count; ?>,
    currentFrame: 1,
    imgList: ‘.threed-view-images’,
    progress: ‘.spinner’,
    imgArray: [<?php echo $images_js_string; ?>],
    height: <?php echo $height ?>,
    width: <?php echo $width ?>,
    responsive: true,
    playSpeed: 300,
    navigation: true
    });
    });
    </script>
    </div>
    <?php
    }

    Thanks

    Attachments:
    You must be logged in to view attached files.
    #466478

    Luke Nielsen
    Keymaster

    Hello,

    Please add the below code to the fucntions.php file in your child theme. Additionally, kindly remove the previously provided code.

    add_filter( 'woodmart_three_sixty_framerate', function () {
    	return 20; // Default 60;
    });

    Kind Regards

    #466777

    uitomatengoed.nl
    Participant

    Thanks, problem solved!

    #466964

    Luke Nielsen
    Keymaster

    Hello,

    Great! In case you need any additional help, I’d be more than happy to assist you.

    Wish you all the best.

    Kind Regards

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘360view speed’ is closed to new replies.