2

Hi I am using Jquery Panzoom Plugin for zoom in and zoom out my image, Plugin Link

I want to set its defualt zoom value by myself

enter image description here

Please tell me how to change this default zoom value i am not able to find with this plugin API ? Please Help ? Thanks

user4441
  • 67
  • 1
  • 9
Ahmad
  • 1,462
  • 5
  • 17
  • 40

1 Answers1

3

i think its better if you do not using it,u can write a code for zooming,that has every feature that you want,i have used panzoom for an stream in my project but it has a lot of problems like lag and not justifying,you can use some thing like this:

  <button onclick="iplus();" >zoom in</button>
<button onclick="iminus();">zoom out</button>
<button onclick="resetzoom();">reset</button>


<div id="mb" class="content" style="width: 800px; height: 800px; cursor: grab; cursor: -o-grab; cursor: -moz-grab; cursor: -webkit-grab; " onclick="iplus();">
    <object data="./1.mp4" width="100" height="200" id="mim" style="overflow: scroll"></object>
</div>
<script type="text/javascript">
    var i = 200;
    function mscale() {

        //$("mim").setStyle = ("trasform", "scale(10,10)");
        document.getElementById("mim").style.zoom=i+"%";
    }
    function iplus() {
        i += 20;
        mscale();
    }

    function resetzoom() {
        document.getElementById("mim").style.zoom = "100%";
    }
    function iminus() {
        i -= 20;
        mscale();
    }

    if (document.getElementById("mb").addEventListener) {
        mb.addEventListener("mousewheel", MouseWheelHandler, false);
    }
    function MouseWheelHandler(event) {
        var delta = 0;
        if (!event) 
            event = window.event;
        if (event.wheelDelta) { 
            delta = event.wheelDelta / 120;
        } 

        if (delta) {
            if (delta > 0) {
                i += 20;
                mscale();
            }
            if (delta < 0) {
                i -= 20;
                mscale();
            }
          }
        if (event.preventDefault)
            event.preventDefault();
        event.returnValue = false;
    }
</script>

and if you want handtool for draging scroll you can use this

Mamo Ghandi
  • 77
  • 2
  • 10