HTML正文CSS转换放大导致内容被删除(HTML Body CSS Transform Scaling Up causing content to be removed)
我正在使用CSS转换来扩展整个页面的一个项目。 扩大了一点之后,来自角落的内容开始变得不可见,因为它们在可见范围之外。 有没有办法通过使用变换缩放垂直滚动或水平滚动来使内容仍然可见?
我目前正在使用JavaScript来扩展身体
document.body.style.transform = 'scale(1.5)';
但是,这会切断页面中的一些内容。 我需要它继续工作,因为我从1.0开始继续扩展。
I am working on a project where I am using CSS transform to scale up the whole body of a page. After scaling up a bit, content from corners start becoming un-viewable because they are outside visible ranges. Is there a way for the content to still be viewable by scrolling vertically or horizontally using transform scaling?
I am currently using Javascript to scale up the body like so
document.body.style.transform = 'scale(1.5)';
However, this cuts off some content from pages. I need it to work as I continue scaling up from 1.0.
原文:https://stackoverflow.com/questions/40955473
最满意答案
为什么要将
std::string
与char*
混合? 你应该直接在字符串上操作:void scrambleString(std::string& str) { int x = str.length(); for(int y = x; y > 0; y--) { int pos = rand()%x; char tmp = str[y-1]; str[y-1] = str[pos]; str[pos] = tmp; } }
用法变为:
std::string value = "This is a test"; scrambleString(value);
话虽这么说, std :: random_shuffle会为你做这个......
Why are you mixing
std::string
withchar*
? You should just operate directly on the string:void scrambleString(std::string& str) { int x = str.length(); for(int y = x; y > 0; y--) { int pos = rand()%x; char tmp = str[y-1]; str[y-1] = str[pos]; str[pos] = tmp; } }
Usage becomes:
std::string value = "This is a test"; scrambleString(value);
That being said, std::random_shuffle will do this for you...
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
嗯,你没有澄清我在评论中提到的所有问题,但是我会假设你想要一个可以使用一串“可能”字符和一段长度的字符串返回的函数。 为了清楚起见,我们会根据要求全面评论,使用比通常更多的变量, function get_random_string($valid_chars, $length) { // start with an empty random string $random_string = ""; // count the number of chars in the valid c ...
-
首先阅读文档,在示例中有您正在寻找的确切功能 http://php.net/manual/en/function.array-rand.php Read ...
-
为什么要将std::string与char*混合? 你应该直接在字符串上操作: void scrambleString(std::string& str) { int x = str.length(); for(int y = x; y > 0; y--) { int pos = rand()%x; char tmp = str[y-1]; str[y-1] = str[pos]; str[pos] = tmp; ...
-
经过大量的研究,我找到了一个很好的答案来解决我的问题。 此代码将动词,名词和所有格形容词字符串拆分为标记,然后根据随机整数从每个字符串中选择一个标记。 然后将这些令牌加起来形成命令性句子。 最后一句显示在16X2字符LCD屏蔽上。 #include
#include #include Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield(); #de ... -
创建随机字符串,检查它是否存在,是否创建了新字符串(Create random string, check if it exists, if it does create a new one)[2022-12-21]
尝试这个: function rand_string(){ $str = substr(md5(microtime()), 0, 5); if(exists_in_db($str)) $str = rand_string(); return $str; } Try this: function rand_string(){ $str = substr(md5(microtime()), 0, 5); if(exists_in_db($str)) $str = ran ... -
Rust支持在函数内部定义函数。 我们可以构建一片函数指针,让rand::sample选择其中的一个,然后调用所选的函数。 extern crate rand; use rand::Rng; pub fn h(x: usize) -> String { fn f0(x: usize) -> String { format!("{} minutes remain.", x) } fn f1(x: usize) -> String { format! ...
-
如果要在随机空间中拆分,可以执行以下操作: String str = "sentence with multiple words and spaces"; String[] split = str.split(" "); // split string at every space Random rand = new Random(); int index = rand.nextInt(split.length); // choose a random space to split at // Co ...
-
您可以从字符串计算哈希值并获取[hash % array.length]的数组项。 DJB hashfunc的一个例子(更多信息见http://www.cse.yorku.ca/~oz/hash.html ): function djbHash(s) { let hash = 5381; for (let c of s) { hash = hash * 33 + c.charCodeAt(0); } return hash; } func ...