Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author YOP

    (@yourownprogrammer)

    Hello

    Edit the poll template you are using (YOP Poll->Templates) and on JavaScript section replace these 2 functions

    function equalWidth_%POLL-ID%(...){..} and function equalWidth2_%POLL-ID%(...){...}

    with the ones below

    function equalWidth_%POLL-ID%(obj, cols, findWidest ) {
    	findWidest  = typeof findWidest  !== "undefined" ? findWidest  : false;
    	if ( findWidest ) {
    		obj.each(function() {
    			var thisWidth = jQuery(this).width();
    			width = parseInt(thisWidth / cols);
    			jQuery(this).width(width);
    			jQuery(this).css("float", "left");
    		});
    	}
    	else {
    		var widest = 0;
    		obj.each(function() {
    			var thisWidth = jQuery(this).width();
    			if(thisWidth > widest) {
    				widest = thisWidth;
    			}
    		});
    		width = parseInt( jQuery('#yop-poll-container-%POLL-ID%') / cols[0]);
    		obj.width(width-20);
    		obj.css("float", "left");
    	}
    }
    
    function equalWidth2_%POLL-ID%(obj, cols, findWidest ) {
    	findWidest  = typeof findWidest  !== "undefined" ? findWidest  : false;
    	if ( findWidest ) {
    		obj.each(function() {
    			var thisWidth = jQuery(this).width();
    			width = parseInt(thisWidth / cols);
    			jQuery(this).width(width);
    			jQuery(this).css("float", "left");
    		});
    	}
    	else {
    		var widest = 0;
    		obj.each(function() {
    			var thisWidth = jQuery(this).width();
    			if(thisWidth > widest) {
    				widest = thisWidth;
    			}
    		});
    		width = parseInt( jQuery('#yop-poll-container-%POLL-ID%') / cols[1]);
    		obj.width(width-20);
    		obj.css("float", "left");
    	}
    }

    Let us know if this fixes your issue.

    Best
    YOP Team

    I need the same feature. I tried this with no success…
    Thnkas for your help.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘100% width with horizontal answers’ is closed to new replies.