Force text wrap for text elements March 31, 2015 07:04AM |
Admin Registered: 16 years ago Posts: 2,160 |
<script> DelayedTextUpdate_Set_MaxCharsPerLine = (function() { var cached_function = DelayedTextUpdate_Set_MaxCharsPerLine; return function() { var local_custom_textwrap_offset = 80; return local_custom_textwrap_offset; }; }()); </script>
<script> DelayedTextUpdate_Set_MaxCharsPerLine = (function() { var cached_function = DelayedTextUpdate_Set_MaxCharsPerLine; return function() { var local_custom_textwrap_offset = 40; // this is the default, just in case we'll match nothing else var local_actual_w = document.getElementById('im_size_w').value; var local_actual_h = document.getElementById('im_size_h').value; var local_ratio = local_actual_w/local_actual_h; if (local_ratio<=0.6) local_custom_textwrap_offset = 10; // near or below 0.5, very tall if (local_ratio>=0.6 && local_ratio<0.8) local_custom_textwrap_offset = 20; // near 0.7, normal portrait if (local_ratio>=0.8 && local_ratio<1.2) local_custom_textwrap_offset = 30; // near 1, almost square if (local_ratio>=1.2 && local_ratio<1.8) local_custom_textwrap_offset = 40; // near 1.5, normal landscape if (local_ratio>=1.8) local_custom_textwrap_offset = 50; // near or above 2, very wide return local_custom_textwrap_offset; }; }()); </script>
Re: Force text wrap for text elements March 31, 2015 08:18AM |
Registered: 9 years ago Posts: 8 |
Re: Force text wrap for text elements March 31, 2015 01:18PM |
Admin Registered: 16 years ago Posts: 2,160 |
var local_custom_textwrap_offset = 40;
var local_custom_textwrap_offset = 40; var local_actual_w = document.getElementById('im_size_w').value; var local_actual_h = document.getElementById('im_size_h').value; if (product_id==12345) local_custom_textwrap_offset = 30; if (product_id==67890 && local_actual_w<=40) local_custom_textwrap_offset = 20; etc....
Re: Force text wrap for text elements April 03, 2015 08:11AM |
Registered: 9 years ago Posts: 8 |
Re: Force text wrap for text elements April 03, 2015 10:48AM |
Admin Registered: 16 years ago Posts: 2,160 |
var local_actual_w = document.getElementById('im_size_w').value; var local_actual_h = document.getElementById('im_size_h').value; var local_ratio = local_actual_w/local_actual_h; if (local_ratio<=0.6) local_custom_textwrap_offset = 10; // near or below 0.5, very tall if (local_ratio>=0.6 && local_ratio<0.8) local_custom_textwrap_offset = 20; // near 0.7, normal portrait if (local_ratio>=0.8 && local_ratio<1.2) local_custom_textwrap_offset = 30; // near 1, almost square if (local_ratio>=1.2 && local_ratio<1.8) local_custom_textwrap_offset = 40; // near 1.5, normal landscape if (local_ratio>=1.8) local_custom_textwrap_offset = 50; // near or above 2, very wide
Re: Force text wrap for text elements April 06, 2015 12:42PM |
Registered: 9 years ago Posts: 8 |
Re: Force text wrap for text elements April 07, 2015 02:46AM |
Admin Registered: 16 years ago Posts: 2,160 |
function Local_Custom_Checksize() { var local_custom_textwrap_offset = 40; return local_custom_textwrap_offset; }
function Local_Custom_Checksize() { var local_custom_textwrap_offset = 40; // this is the default, just in case we'll match nothing else var local_actual_w = document.getElementById('im_size_w').value; var local_actual_h = document.getElementById('im_size_h').value; var local_ratio = local_actual_w/local_actual_h; if (local_ratio<=0.6) local_custom_textwrap_offset = 10; // near or below 0.5, very tall if (local_ratio>=0.6 && local_ratio<0.8) local_custom_textwrap_offset = 20; // near 0.7, normal portrait if (local_ratio>=0.8 && local_ratio<1.2) local_custom_textwrap_offset = 30; // near 1, almost square if (local_ratio>=1.2 && local_ratio<1.8) local_custom_textwrap_offset = 40; // near 1.5, normal landscape if (local_ratio>=1.8) local_custom_textwrap_offset = 50; // near or above 2, very wide return local_custom_textwrap_offset; }
Re: Force text wrap for text elements April 07, 2015 06:24AM |
Registered: 16 years ago Posts: 1,045 |
Re: Force text wrap for text elements April 07, 2015 08:14AM |
Admin Registered: 16 years ago Posts: 2,160 |
Re: Force text wrap for text elements April 07, 2015 08:42AM |
Registered: 9 years ago Posts: 8 |
Re: Force text wrap for text elements April 07, 2015 09:52AM |
Admin Registered: 16 years ago Posts: 2,160 |
Re: Force text wrap for text elements April 07, 2015 09:59AM |
Registered: 9 years ago Posts: 8 |
Re: Force text wrap for text elements April 07, 2015 08:50PM |
Registered: 16 years ago Posts: 1,045 |
Re: Force text wrap for text elements April 08, 2015 03:48AM |
Admin Registered: 16 years ago Posts: 2,160 |
Re: Force text wrap for text elements April 08, 2015 08:30AM |
Registered: 9 years ago Posts: 8 |
Re: Force text wrap for text elements April 08, 2015 09:57AM |
Admin Registered: 16 years ago Posts: 2,160 |
Re: Force text wrap for text elements April 08, 2015 01:29PM |
Registered: 9 years ago Posts: 8 |