does anyone know how to measure the time that an image in an Bootstarp 5 carousel (see below) is visible for the user? The idea is to measure the time that the user is looking at a specific image (e.g. image of a product) in the carousel.
f.e. the time in milliseconds that the image "image_1" is visible (open).
Many thanks,
````
<div id="carouselExampleControls" class="carousel slide" data-bs-ride="carousel" data-bs-interval="false">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="..." class="d-block w-100" alt="image_1">
</div>
<div class="carousel-item">
<img src="..." class="d-block w-100" alt="image_2">
</div>
<div class="carousel-item">
<img src="..." class="d-block w-100" alt="image_3">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
````
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment