WordPress.org

Ready to get started?Download WordPress

Forums

Flip Pong V
Zoom (6 posts)

5 stars
  1. Erick Barcellos Muller
    Member
    Posted 7 months ago #

    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?

  2. tambourdeville
    Member
    Plugin Author

    Posted 7 months ago #

    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() ).

  3. Erick Barcellos Muller
    Member
    Posted 7 months ago #

    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>

  4. tambourdeville
    Member
    Plugin Author

    Posted 7 months ago #

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

  5. Erick Barcellos Muller
    Member
    Posted 7 months ago #

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

  6. Erick Barcellos Muller
    Member
    Posted 7 months ago #

    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.]

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.