Beispiel #1
0
function game_cross_show_legends($cross)
{
    echo '<td>';
    ShowLegend($cross->m_LegendH, get_string('cross_across', 'game'));
    ShowLegend($cross->m_LegendV, get_string('cross_down', 'game'));
    echo '</td>';
}
Beispiel #2
0
function game_cross_show_legends($cross)
{
    echo '<div id="acc"></div><div id="legend">';
    echo '<script type="text/javascript">var width = jQuery(window).width();if(width >= 768 ){ jQuery("#legend").addClass("legend-web");}jQuery(".heading").text(jQuery(".heading").text());</script>';
    ShowLegend("V", $cross->m_LegendV, get_string('cross_down', 'game'));
    echo '<div id="across-div">';
    ShowLegend("H", $cross->m_LegendH, get_string('cross_across', 'game'));
    echo '</div></div><div id="across-legend"></div>';
    echo '<script type="text/javascript">var width = jQuery(window).width();if(width > 768 ){ 
		if(navigator.platform == "iPad Simulator" || navigator.platform == "iPad"){
			jQuery("#acc").html(jQuery("#across-div").html());jQuery("#across-div").html("");	
			jQuery("#legend").removeClass("legend-web");
		}else{
				jQuery("#across-legend").html(jQuery("#across-div").html());jQuery("#across-div").hide();	
		}
		}else{
			jQuery("#acc").html(jQuery("#across-div").html());jQuery("#across-div").html("");	 
		}
		var crossInterval=setInterval(function(){
			var divheight = jQuery(".heading").height(); 
			if(divheight!=0 && divheight != "null" && divheight != null){
			var lineheight = jQuery(".heading").css("line-height").replace("px","");
			var count = Math.round(divheight/parseInt(lineheight));
			if(count > 1){
			var actualheight = (parseInt(count-1)*30)+93;
			jQuery("#across-legend").css("top",actualheight);
			jQuery("#legend").css("top",actualheight);  }
			clearInterval(crossInterval);
			}
			else{
				jQuery("#across-legend").css("top","43px");
				jQuery("#legend").css("top","43px");
				clearInterval(crossInterval);
			}
		},500);
	</script>';
}