• Best plugin, already looked in many places. But this is the best!

    Is it possible to change the zoom on this button for an onclick in the image?

    Or have a plugin that does this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author tambourdeville

    (@tambourdeville)

    HI! Thanks!
    I think you can do that by modifying the file single-flip_pong.php (in your theme directory).
    The onclick is normally set on the zoom button, and it launch the JS function supazoomin().
    I think you can put it on images, but I guess you’ll have to create a “toggle condition”: if the books is on normal scale, you zoom in, and if it’s on “zoomed-scale”, you un-zoom it (with the JS function supazoomout() ).

    Thread Starter Erick Barcellos Muller

    (@erick-barcellos-muller)

    Thanks buddy, that’s what I did. And it worked. I’ll post here to help the next. Or even to help the next version.

    <script>

    $(“#flipbook”).click(function(){

    $(this).toggleClass(function(index, classold, classtroca) {
    if ( $( this ).is(“.semzoom”) ) {
    supazoomin();
    } else {
    supazoomout();
    }
    });

    });

    </script>

    Plugin Author tambourdeville

    (@tambourdeville)

    Cool! Glad you succeed!
    May I see the result ?

    Thread Starter Erick Barcellos Muller

    (@erick-barcellos-muller)

    This is a project in production yet. It is being done locally. Once completed I will post here.

    Thread Starter Erick Barcellos Muller

    (@erick-barcellos-muller)

    Inside the js folder is a file called script. In the end it has a code to supazoomin and supazoomout. What is the purpose?

    /* function supazoomin(){
    
    	var supazoom = 1.5;
    	supazoom = $("#magazine").turn("zoom");
    	supazoom += 0.5;
    	$("#magazine").turn("zoom", supazoom);
    	var img = document.getElementsByClassName('flipbookimg');
    	for (var i = 0; i < img.length; i++) {
    		var width = img[i].width;
    		var width = (width*0.5);
    		img[i].width += width;
    	}
    
    }
    
    function supazoomout(){
    	var supazoom = 1.5;
    	supazoom = $("#magazine").turn("zoom");
    	if(supazoom <= 1){ return 0;}
    	supazoom -= 0.5;
    	$("#magazine").turn("zoom", supazoom);
    	var img = document.getElementsByClassName('flipbookimg');
    	for (var i = 0; i < img.length; i++) {
    		var width = img[i].width;
    		var width = (width*(1/3));
    		img[i].width -= width;
    	}
    }*/

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Zoom’ is closed to new replies.