Get the size of the current screen/window
The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
var w = window.innerWidth;
var h = window.innerHeight;
var x = document.getElementById("demo");
x.innerHTML = "Browser width: " + w + ", height: " + h + ".";
< /code>
На веб -странице выводит следующее < /p>
Get the size of the current screen/window
The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
Browser width: 1920, height: 892.
< /code>
, который, как я предполагаю, верен, так как он выглядит правильно для разрешения экрана.
Я затем передал переменные в php < /p>
< /code>
Результат < /p>
Get the size of the current screen/window
The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
Browser width: 1920, height: 892.
$STR_phpwidth is a string variable, and has a value of 1920
$STR_phpheight is a string variable, and has a value of 892
< /code>
Я хочу иметь возможность разрабатывать проценты размера экрана, поэтому я преобразовал строковые переменные в Float /Doubles < /p>
$DOU_floatwidth = floatval($STR_phpwidth);
$DOU_floatheight = floatval($STR_phpheight);
echo '$DOU_floatwidth is a ' . gettype($DOU_floatwidth) . ' variable, and has a value of ' . $DOU_floatwidth . '
';
echo '$DOU_floatheight is a ' . gettype($DOU_floatheight) . ' variable, and has a value of ' . $DOU_floatheight . '
';
< /code>
и выход теперь < /p>
Get the size of the current screen/window
The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
Browser width: 1920, height: 892.
$STR_phpwidth is a string variable, and has a value of 1920
$STR_phpheight is a string variable, and has a value of 892
$DOU_floatwidth is a double variable, and has a value of 0
$DOU_floatheight is a double variable, and has a value of 0
< /code>
Как видите, строка не была передана и преобразована в Float /Double. Я пробовал несколько разных методов, включая $ dou_floatwidth = (float) $ str_phpwidth;
, а также использование floatval и float на начальной $ str_phpwidth . Если я передаю значения, используя < /p>
$STR_phpwidth = "1920";
$STR_phpheight = "892";
< /code>
Тогда я ожидаю полный вывод. < /p>
Get the size of the current screen/window
The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
Browser width: 1920, height: 892.
$STR_phpwidth is a string variable, and has a value of 1920
$STR_phpheight is a string variable, and has a value of 892
$DOU_floatwidth is a double variable, and has a value of 1920
$DOU_floatheight is a double variable, and has a value of 892
$DOU_onepercent is a double variable
1% of the screen width is 19.2px
< /code>
Полная страница /код: < /p>
Get the size of the current screen/window
The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
var w = window.innerWidth;
var h = window.innerHeight;
var x = document.getElementById("demo");
x.innerHTML = "Browser width: " + w + ", height: " + h + ".";
Я пытался получить видимую область веб -страницы и передать ее в переменную PHP. Код сценария, который я использовал: < /p> [code]
Get the size of the current screen/window The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
var w = window.innerWidth; var h = window.innerHeight; var x = document.getElementById("demo"); x.innerHTML = "Browser width: " + w + ", height: " + h + ".";
< /code> На веб -странице выводит следующее < /p> Get the size of the current screen/window The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
Browser width: 1920, height: 892. < /code> , который, как я предполагаю, верен, так как он выглядит правильно для разрешения экрана. Я затем передал переменные в php < /p>
< /code> Результат < /p> Get the size of the current screen/window The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
Browser width: 1920, height: 892.
$STR_phpwidth is a string variable, and has a value of 1920 $STR_phpheight is a string variable, and has a value of 892 < /code> Я хочу иметь возможность разрабатывать проценты размера экрана, поэтому я преобразовал строковые переменные в Float /Doubles < /p> $DOU_floatwidth = floatval($STR_phpwidth); $DOU_floatheight = floatval($STR_phpheight); echo '$DOU_floatwidth is a ' . gettype($DOU_floatwidth) . ' variable, and has a value of ' . $DOU_floatwidth . ' '; echo '$DOU_floatheight is a ' . gettype($DOU_floatheight) . ' variable, and has a value of ' . $DOU_floatheight . '
'; < /code> и выход теперь < /p> Get the size of the current screen/window The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
Browser width: 1920, height: 892.
$STR_phpwidth is a string variable, and has a value of 1920 $STR_phpheight is a string variable, and has a value of 892
$DOU_floatwidth is a double variable, and has a value of 0 $DOU_floatheight is a double variable, and has a value of 0 < /code> Как видите, строка не была передана и преобразована в Float /Double. Я пробовал несколько разных методов, включая $ dou_floatwidth = (float) $ str_phpwidth; [/code], а также использование floatval и float на начальной $ str_phpwidth . Если я передаю значения, используя < /p> [code]$STR_phpwidth = "1920"; $STR_phpheight = "892"; < /code> Тогда я ожидаю полный вывод. < /p> Get the size of the current screen/window The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
Browser width: 1920, height: 892.
$STR_phpwidth is a string variable, and has a value of 1920 $STR_phpheight is a string variable, and has a value of 892
$DOU_floatwidth is a double variable, and has a value of 1920 $DOU_floatheight is a double variable, and has a value of 892
$DOU_onepercent is a double variable 1% of the screen width is 19.2px < /code> Полная страница /код: < /p>
Get the size of the current screen/window The example displays the browser window's height and width: (NOT including toolbars/scrollbars)
var w = window.innerWidth; var h = window.innerHeight; var x = document.getElementById("demo"); x.innerHTML = "Browser width: " + w + ", height: " + h + ".";
Когда я нажимаю кнопку, я хочу, чтобы строковое значение, введенное пользователем, сохранялось в файле.
private: System::Void add_task_Click(System::Object^ sender, System::EventArgs^ e) {
У меня возникли проблемы с манипулированием набором данных в Python, который содержит символы, отличные от UTF-8. Строки импортируются как двоичные. Но у меня возникли проблемы с преобразованием двоичных столбцов в строки, в которых ячейка содержит...
Я создаю игру, используя pygame, и пытаюсь создать функцию для создания переменной и присвоения ее классу. Однако вместо этого происходит просто переназначение переменной.
Вот функция:
def drawBox(name, text, textsize, textcolour, font, size, pos,...