Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ion slide box - how to slide full width iframe videos in ion slide

On my page I am having an ion-slide-box for images. Since in my app users will be able to embed videos, I should also add iframes with videos to the same slider. This is how my code looks like now:

This is my html:

<ion-slide-box ng-if="slider.length > 1">
  <ion-slide ng-repeat="item in slider">
    <img ng-if="item.image" ng-src="{{ fileServer }}/imagecache/cover/{{ item.image }}" class="cover">
    <iframe ng-if="item.video" src="{{ item.video | safeUrl }}"></iframe>
  </ion-slide>
</ion-slide-box>

This works fine with only images, but when I have videos I can't slide them if they take up 100% width, which I have set up in my css, I can only slide them if they are wide less than that and if I slide them only on that part where the iframe is not taking up space in the slider. Since I need to have iframe taking up 100% width, I wonder how to make it work?

like image 575
Ludwig Avatar asked Jul 06 '16 14:07

Ludwig


People also ask

How do I add custom animations to Ion-slides?

The following documentation applies to the ion-slides component. By default, Ionic slides use the built-in slide animation effect. Custom animations can be provided via the options property. Examples of other animations can be found below. ? Math.max(1 - Math.abs($slideEl[0].progress), 0)

Can I still use ionic slides components?

With the release of Ionic Framework v6, the Ionic Team has deprecated the ion-slides and ion-slide components in favor of using the official framework integrations provided by Swiper. Fear not! You will still be able to use slides components in your application.

How does the slides component work?

The Slides component is a multi-section container. Each section can be swiped or dragged between. It contains any number of Slide components.

What is ion-slides in ionic framework?

The library is bundled automatically with all versions of Ionic Framework. When Ionic Framework v4. was first released, Swiper did not have framework specific integrations of its library, so ion-slides was created as a way of bridging the gap between the core Swiper library and frameworks such as Angular, React, and Vue.


1 Answers

Have you tried ion-slides instead?

ion-slide-box is deprecated

ion-slide-box will be removed in the next Ionic release in favor of the new ion-slides component. Don't depend on the internal behavior of this widget.

like image 87
Lightbeard Avatar answered Oct 26 '22 23:10

Lightbeard