Hi there,
I have the following code:
<div class="slider">
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
</div>
<div class="product-video">
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag.
</video>
</div>
I would like to move the video from the current div
into a new div
with the class slide
after the last slide
div
above.
I have tried this, which moves it to the end, but I would like to add it into a a div
so it has the slide
class.
So it becomes:
<div class="slider">
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
<div class="slide">
<div class="woocommerce-product-gallery__image">image</div>
</div>
<div class="slide">
<div class="woocommerce-product-gallery__image">VIDEO HERE</div>
</div>
</div>
This is what I have tried:
jQuery(".product-video ").appendTo(".product-slider .slider > .slide:last-of-type ");
Can anyone suggest how to get the video into it’s own slide
class and at the end of the other slide
div
s?
Many thanks!