All Projects → Riron → Ionic Img Viewer

Riron / Ionic Img Viewer

Licence: mit
Ionic 2+ component providing a Twitter inspired experience to visualize pictures.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Ionic Img Viewer

Awesome Ionic
An "awesome" list of Ionic resources
Stars: ✭ 799 (+174.57%)
Mutual labels:  cordova, ionic-framework, ionic2
ionic-3-video-calling-using-webrtc
This is demo code of how to implement video calling in ionic 3 using webrtc
Stars: ✭ 58 (-80.07%)
Mutual labels:  cordova, ionic-framework, ionic2
Simple Ionic 3 App
A simple Ionic 3 app with get requests to a local JSON file. It showcases how to set up a simple service and provides some nice components for your own application.
Stars: ✭ 59 (-79.73%)
Mutual labels:  cordova, ionic-framework, ionic2
ionic-hockeyapp
Need HockeyApp in your Ionic application, add this package!
Stars: ✭ 19 (-93.47%)
Mutual labels:  cordova, ionic-framework, ionic2
todo-list
TodoList using Ionic2/3 & Firebase: * PWA * SSO Google plus. * Share list via QRcode. * Upload image from Camera or Storage. * Speech Recognition.
Stars: ✭ 18 (-93.81%)
Mutual labels:  cordova, ionic-framework, ionic2
Wooionic3
An eCommerce App for WooCommerce stores using Ionic 3.
Stars: ✭ 208 (-28.52%)
Mutual labels:  cordova, ionic-framework, ionic2
Awesome Ionic2 Components
Should help you to get awesome components and plugins for Ionic2
Stars: ✭ 209 (-28.18%)
Mutual labels:  cordova, ionic-framework, ionic2
Ioniclub
❤️ Ioniclub is hybird mobile app of https://cnodejs.org
Stars: ✭ 35 (-87.97%)
Mutual labels:  cordova, ionic2
ionicfirebaseauth
Exemplo de alguns tipos de autenticação com Ionic 2 e Firebase
Stars: ✭ 18 (-93.81%)
Mutual labels:  ionic-framework, ionic2
ionic-workflow-guide
Create a full and powerful worflow with Ionic (Unit Testing, Environment variables, Automatic documentation, Production App Server, Automatic deployment)
Stars: ✭ 46 (-84.19%)
Mutual labels:  ionic-framework, ionic2
ionic-uber-clone
Ionic 4 Taxi Booking script
Stars: ✭ 34 (-88.32%)
Mutual labels:  ionic-framework, ionic2
Ionic-ElastiChat-with-Images
Ionic Magic Chat with Angular Elastic, Autolinker.js and more!
Stars: ✭ 66 (-77.32%)
Mutual labels:  cordova, ionic-framework
keyonic-v2
A Keycloak Mobile Implementation using Angular v4 and Ionic v3
Stars: ✭ 23 (-92.1%)
Mutual labels:  cordova, ionic-framework
mobile-app
This project aims to build a modern mobile web-app based on the framework Ionic to improve the functionality of http://mobile.leitstelle122.at/.
Stars: ✭ 22 (-92.44%)
Mutual labels:  cordova, ionic-framework
ionic-video-chat-support
Ionic 3 Video and Group Text Chat
Stars: ✭ 19 (-93.47%)
Mutual labels:  ionic-framework, ionic2
ionic2-geofence
Ionic2 Geofencing Sample Project
Stars: ✭ 96 (-67.01%)
Mutual labels:  ionic-framework, ionic2
ionic4-angular7-example
Ionic 4, Angular 7 and Cordova Tutorial: Build CRUD Mobile Apps
Stars: ✭ 57 (-80.41%)
Mutual labels:  cordova, ionic-framework
cordova-plugin-today-widget
Add a today widget app extension target to your cordova project.
Stars: ✭ 51 (-82.47%)
Mutual labels:  cordova, ionic2
ionic-native-sms-retriever-plugin-master
Cross-platform plugin for Cordova / PhoneGap to Retrieve SMS. Available for Android.
Stars: ✭ 16 (-94.5%)
Mutual labels:  cordova, ionic-framework
ngx-ionic-image-viewer
An Ionic 4 Angular component to view & zoom on images and photos without any additional dependencies.
Stars: ✭ 129 (-55.67%)
Mutual labels:  viewer, ionic-framework

Image viewer for Ionic 2+

NPM

Ionic 2 plugin providing a Twitter inspired experience to visualize pictures.

Plugin preview

Features

  • Tap on the pic to see it fullscreen
  • Slide up/down to close the view
  • Tap on the navigation arrow to close the view
  • Double tap / pinch the pic when open to zoom

Demo

Demo on Plunkr

Installation

Make sure you have Ionic and Angular installed.

npm install --save ionic-img-viewer

Check you peer-dependencies warnings after npm install to make sure you are using a version in accordance to your Ionic version.

For Ionic 2 RC.0 and later:

import { IonicImageViewerModule } from 'ionic-img-viewer';

@NgModule({
  imports: [
    IonicImageViewerModule
  ]
})
export class AppModule {}

Usage

As a directive

Add the imageViewer property to the image element.

<img src="IMAGE_URL" imageViewer />

If you use thumbnails and want to display bigger images, you can use it like so :

<img src="IMAGE_URL" imageViewer="OTHER_IMAGE_URL" />

However, if OTHER_IMAGE_URL is not preloaded, the animation might suffer. There will be no loaded image to display in order to have the nice and smooth transition, and you might see the image blinking while opening it.

So try to cache your image before the call if you use it that way.

React to close event

If you need to, you can attach a callback to close event, fired right after the image viewer element has been closed :

<img src="IMAGE_URL" imageViewer (close)="callbackAfterImageViewerCloses()" />

Programmatic usage

If you don't want to use the directive, you can create an instance of the ImageViewer yourself and trigger the presentation whenever you want.

<img src="IMAGE_URL" #myImage (click)="presentImage(myImage)" />
import { ImageViewerController } from 'ionic-img-viewer';

export class MyPage {
  _imageViewerCtrl: ImageViewerController;

  constructor(imageViewerCtrl: ImageViewerController) {
    this._imageViewerCtrl = imageViewerCtrl;
  }

  presentImage(myImage) {
    const imageViewer = this._imageViewerCtrl.create(myImage);
    imageViewer.present();

    setTimeout(() => imageViewer.dismiss(), 1000);
    imageViewer.onDidDismiss(() => alert('Viewer dismissed'));
  }
}

As a second argument to the create(imageElement, config) method, you can pass an object with the following options.

Options Type Description
fullResImage string A full resolution image to display instead of the original image when open. Defaults to null
onCloseCallback Function Function to be called when the ImageViewer quits. Defaults to null
enableBackdropDismiss boolean Boolean to enable dismiss when clicking on the back drop. Defaults to false

Contributing

See CONTRIBUTING.md.

Thank you, contributors!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].