Coder Social home page Coder Social logo

Comments (4)

Mottie avatar Mottie commented on June 12, 2024

Hi @amitchoubey!

Can you please elaborate, what do you mean by rotate zoomer from left to right?

If you would please, modify this demo to show what you have so far and maybe I can help troubleshoot the problem.

from anythingzoomer.

amitchoubey avatar amitchoubey commented on June 12, 2024

I want that on page load magnifier box will move on text or image from left position to right position automatically without moving mouse. Its like we are showing demo to some how AnythingZoomer works when we manually move mouse over image or text.

from anythingzoomer.

Mottie avatar Mottie commented on June 12, 2024

Hi, yes it is possible.

It's not pretty, at least to me... here is a demo that allows you to set a start and end position, duration and easing for the animation.

var curLeft = 70,
    curTop = 50,
    endLeft = 150,
    endTop = 70,
    zoomWindowSize = 100,
    duration = 'slow',
    easing = 'linear',
    $zoom = $( '#zoom' ).anythingZoomer();

// ** DON'T CHANGE ANYTHING BELOW **
$zoom.anythingZoomer( curLeft, curTop, [ zoomWindowSize, zoomWindowSize ] );

// add a dummy div to animate; so we get the correct
// left & top position for the zoom window
var $div = $( '<div>', {
    css: {
        position: 'absolute',
        left: curLeft,
        top: curTop
    }
}).appendTo('body');
$div.animate({
    left: endLeft,
    top: endTop
}, {
    step: function ( now, tween ) {
        if ( tween.prop === 'left' ) {
            curLeft = now;
        } else {
            curTop = now;
        }
        // update AnythingZoomer
        $zoom.anythingZoomer( curLeft, curTop );
    },
    duration: duration,
    easing: easing,
    complete: function(){
        $div.remove();
    }
});

from anythingzoomer.

amitchoubey avatar amitchoubey commented on June 12, 2024

@Mottie Thanx for demo and help.

from anythingzoomer.

Related Issues (20)

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.