Coder Social home page Coder Social logo

174n / vue-zoom-on-hover Goto Github PK

View Code? Open in Web Editor NEW

This project forked from intera/vue-zoom-on-hover

19.0 2.0 10.0 683 KB

Vue.js component that shows the full image or a scaled image in the image area on hover. Demo:

Home Page: https://rundik.github.io/vue-zoom-on-hover/example/

License: GNU General Public License v3.0

JavaScript 10.77% Vue 79.88% HTML 9.34%

vue-zoom-on-hover's Introduction

vue-zoom-on-hover

last commit version downloads gziped license

Vue.js component that shows the full image or a scaled image in the image area on hover. Forked from here

Demo

Live demo

Usage

Install package:

npm i vue-zoom-on-hover

Register the component:

import ZoomOnHover from "vue-zoom-on-hover";
Vue.use(ZoomOnHover);

With cdn:

<script type="module">
  import ZoomOnHover from "https://unpkg.com/vue-zoom-on-hover@latest/dist/index.esm.min.js";
  Vue.use(ZoomOnHover);
  new Vue({
    el: "#app"
  })
</script>

Use it like this:

<div style="width:400px">
  <zoom-on-hover img-normal="image.jpg"></zoom-on-hover>
</div>

All options:

<zoom-on-hover img-normal="image.jpg" img-zoom="bigger-image.jpg" :scale="1.5" :disabled="true"
  @loaded="onload" @resized="onresize"></zoom-on-hover>

Features

  • enabled/disabled property
  • custom scale for zoomed image
  • optionally a separate zoom image
  • event when all images loaded
  • event when images resized (responsive css, etc)

Caveats

if the parent container is bigger than the source image, the normal image stretches to the size of the parent container but the zoom image will have the original width (will be smaller for example)

Possible enhancements

  • support for touch devices

vue-zoom-on-hover's People

Contributors

174n avatar astehlik avatar jkalbhenn avatar jorgevv avatar mrnightingale avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue-zoom-on-hover's Issues

Thank you! ❤️

I just wanted to say thank you! I was looking for such library for a long time. Installation process was very straightforward. I added it to on of projects and it's just working!

SSR

Any tips on how to use it with Nuxt?

disable touch support

Hi.. is there an easy way to disable touch support? Trying to mess with the src code but I don't want to break things.. Great library though!

IE 11 support

Hey guys

We love your library, but we have a responsibility to maintain Ie11.

There is an arrow function in one of the places in your code.
Please rewrite this function so that Ie11 does not break

thank
image
image
image

No longer working in Safari?

Hi guys!

Great work here, it's been a very solid component!

It seems that it stopped working on destktop Safari? Tested on a couple different Macbooks.
The images appear, but no zoom on hover

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.