Home › Forums › WoodMart support forum › 360view speed
360view speed
- This topic has 3 replies, 2 voices, and was last updated 1 year, 7 months ago by Luke Nielsen.
-
AuthorPosts
-
May 11, 2023 at 11:47 pm #466318
uitomatengoed.nlParticipantHi,
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.May 12, 2023 at 2:55 pm #466478
Luke NielsenKeymasterHello,
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
May 14, 2023 at 2:03 pm #466777
uitomatengoed.nlParticipantThanks, problem solved!
May 15, 2023 at 12:44 pm #466964
Luke NielsenKeymasterHello,
Great! In case you need any additional help, I’d be more than happy to assist you.
Wish you all the best.
Kind Regards
-
AuthorPosts
The topic ‘360view speed’ is closed to new replies.
- You must be logged in to create new topics. Login / Register