在Materialise.css中获取视差效果需要任何特殊图像吗?(Do you need any special image for getting Parallax effect in Materialize.css?)
我正在使用Materialise CSS。
我的代码:
<div class="parallax-container"> <div class="parallax"> <img src="../../public/assets/img/mount.jpg" /> </div> </div> <div class="parallax-container"> <div class="parallax"> <img src="http://www.mrwallpaper.com/wallpapers/landscape-georgia.jpg"> </div> </div>
只有第二个图像在滚动时似乎获得视差效果,而第一个图像似乎以相同的速度移动。
mount.jpg
只是我计算机中的随机图像。而且..当然我在javascript中初始化了视差。
$('.parallax').parallax();
I am using Materialize CSS.
My code :
<div class="parallax-container"> <div class="parallax"> <img src="../../public/assets/img/mount.jpg" /> </div> </div> <div class="parallax-container"> <div class="parallax"> <img src="http://www.mrwallpaper.com/wallpapers/landscape-georgia.jpg"> </div> </div>
Only the second image seems to get a parallax effect while scrolling whereas the first one seems to move with the same speed.
mount.jpg
is just a random image in my computer.And.. of course I did initialize parallax in javascript.
$('.parallax').parallax();
原文:https://stackoverflow.com/questions/43304933
最满意答案
不知道您是否仍需要帮助,但如果您希望能够将环境变量存储在文件中,则可以使用使用
zeus init
生成的custom_plan.rb
。 以下是我的文件的副本。 我正在使用Omniauth并且需要我的密钥可以轻松更改。 您可以通过重载server
方法来添加仅服务器变量,只需知道您的初始化程序将在服务器命令之前运行。require 'zeus/rails' class CustomPlan < Zeus::Rails def boot # Omniauth Keys # GOOGLE+ ENV['GPLUS_KEY'] = 'xxx' ENV['GPLUS_SECRET'] = 'xxx' # FACEBOOK ENV['FACEBOOK_KEY'] = 'xxx' ENV['FACEBOOK_SECRET'] = 'xxx' super # Finish boot end end Zeus.plan = CustomPlan.new
Don't know if you still need help with but if you want to be able to store environmental variables in a file you can use the
custom_plan.rb
that is generated withzeus init
. Below is a copy of my file. I am using Omniauth and need my keys to be easily changeable. You can add server only variables by overloading theserver
method instead, just know that your initializers will be ran before the server command.require 'zeus/rails' class CustomPlan < Zeus::Rails def boot # Omniauth Keys # GOOGLE+ ENV['GPLUS_KEY'] = 'xxx' ENV['GPLUS_SECRET'] = 'xxx' # FACEBOOK ENV['FACEBOOK_KEY'] = 'xxx' ENV['FACEBOOK_SECRET'] = 'xxx' super # Finish boot end end Zeus.plan = CustomPlan.new
相关问答
更多-
最好的解决方案我现在想出的是: # config/spring.rb Spring.after_fork do `killall -v -9 rots & bundle exec rots 1> log/rots.log &` `killall -v -9 stripe-mock-server & bundle exec stripe-mock-server 1> log/stripe-mock-server.log &` end 首先我杀死所有rots和stripe-mock-server如果存 ...
-
我应该如何将敏感环境变量传递给Amazon ECS任务?(How should I pass sensitive environment variables to Amazon ECS tasks?)[2023-10-12]
在您发布的任务定义链接中有一个“环境”部分,可以让您执行此操作。 它们成为容器内的环境变量。 如果你的意思是你想保留任务定义之外的信息并且该任务可以引用它,那么你不能。 在这种情况下,最好的办法是让你的容器从外部源获取这些信息,而不要让ECS任务配置尝试引用它。 In the task definition link you posted there is an "environment" section that allows you to do this. They become environment ... -
nosetests框架:如何将环境变量传递给我的测试?(nosetests framework: how to pass environment variables to my tests?)[2021-10-10]
我无法让env自己也行动起来,但我想出了一个解决方案,我认为它比打开一个子过程要轻松得多。 在调用nose.run()之前,可以修改os.environ变量,只要测试在同一个进程中运行,测试将全部看到修改的os.environ : #!/usr/bin/env python import os, nose, unittest class Test(unittest.TestCase): def test_env(self): self.assertEquals(os.environ ... -
不知道您是否仍需要帮助,但如果您希望能够将环境变量存储在文件中,则可以使用使用zeus init生成的custom_plan.rb 。 以下是我的文件的副本。 我正在使用Omniauth并且需要我的密钥可以轻松更改。 您可以通过重载server方法来添加仅服务器变量,只需知道您的初始化程序将在服务器命令之前运行。 require 'zeus/rails' class CustomPlan < Zeus::Rails def boot # Omniauth Keys # GOOGL ...
-
您可以使用-e标志将环境变量传递到容器。 启动脚本的一个例子: sudo docker run -d -t -i -e REDIS_NAMESPACE='staging' \ -e POSTGRES_ENV_POSTGRES_PASSWORD='foo' \ -e POSTGRES_ENV_POSTGRES_USER='bar' \ -e POSTGRES_ENV_DB_NAME='mysite_staging' \ -e POSTGRES_PORT_5432_TCP_ADDR='docker-db-1. ...
-
将环境变量传递给Jenkins的Ant build.xml?(Pass environment variables to Ant build.xml from Jenkins?)[2023-04-15]
您可以使用构建参数设置属性(即:myParameter),并使用${myParameter}将它们放入蚂蚁脚本中。 只要确保jenkins中的参数名称中不使用点,因为在ant脚本中可能会遇到问题。 至于环境变量,我不知道,对不起。 You can set properties with build parameters (ie: myParameter) and get them in an ant script with ${myParameter}. Just make sure you don't u ... -
如何将dockerfile环境变量传递给node.js文件?(How to pass dockerfile environment variables to node.js file?)[2022-11-16]
您应该可以通过process.env将它们放到Node.js中 process.env.iamIP2 // "10.118.225.199" process.env.iamPort // 9999 process.env.iamPort2 // 9997 process.env.mongoDBurl // 10.118.225.149:27017/globalIndex You should be able to get them in Node.js with process. ... -
我遇到了同样的问题。 我的解决方案是在docker-compose.yml中提供变量,因为yml支持使用环境变量。 在我看来,这对我来说是最有效的方式,因为我不喜欢在命令行中使用诸如docker run -e myuser=$USER . . .类的东西一遍又一遍地输入它docker run -e myuser=$USER . . . docker run -e myuser=$USER . . . 声明ENV myuser=$USER将null ,在容器中, $myuser将设置为null 。 所以你的d ...
-
在这两个脚本中,您不仅要使用react-native替换运行命令(及其选项), webpack-dev-server ,而是使用&&更改它以运行两个不同的命令。 cross-env只将环境变量应用于immediate命令,在你的情况下,它根本不执行任何操作,因为除了环境变量之外没有命令(另请参阅cross-env - Gotchas )。 react-native脚本应该是: cross-env NODE_ENV=development BABEL_ENV=development_rn react-nati ...
-
如何将环境变量传递到通过堆栈运行的Haskell程序?(How to pass environment variables into Haskell programs run via stack?)[2022-12-19]
看起来这是堆栈手册的相关部分 ,我错过了: “默认情况下,堆栈将在纯Nix构建环境(或shell)中运行构建,这意味着两件重要的事情:(1)基本上没有环境变量将从您的用户会话转发到nix-shell [...] ” 所以这个建议有效: “要覆盖此行为,请将pure:false添加到stack.yaml或将--no-nix-pure选项传递给命令行。” % FOOBAR=123 stack --no-nix-pure runhaskell testenv.hs "123" It seems like thi ...