我在我的网站上有视差效果,但在滚动时它似乎相当跳跃如下:
这是代码:
jQuery(document).ready(function() {
jQuery(window).scroll(function() {
jQuery('*[class^="prlx"]').each(function(r) {
var pos = $(this).offset().top;
var scrolled = $(window).scrollTop();
jQuery('*[class^="prlx"]').css('top', +(scrolled * 0.6) + 'px');
});
});
});Run Code Online (Sandbox Code Playgroud)
*[class^="prlx"] {
position: absolute;
width: 100%;
height: 300%;
top: 0;
left: 0;
z-index: -1;
background-size: 110%;
}
.prlx-2 {
background-image: url('http://www.roscodigitalmedia.co.uk/rosco/wp-content/uploads/2015/12/bigstock-Artist-Photographer-Retouches-91840682.jpg');
}Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="container-fluid homeHeader">
<div class="prlx-2">
</div>
</div>Run Code Online (Sandbox Code Playgroud)
更新:在进一步测试中,它似乎在Chrome中完美运行,但Safari和FireFox正在显示此问题.
我试图让Swift中的UILabel成为一个完美的圆圈,我目前正在使用以下内容:
pResult.layer.masksToBounds = true
pResult.layer.cornerRadius = 125
Run Code Online (Sandbox Code Playgroud)
这个问题是它在6s Plus上工作正常,但任何其他尺寸当然都是不同的形状 - 最好的方法是什么?
我试图使用以下代码包含脚本.
<div class="main_content">
<?php include ('tweets.php') ?>
</div>
Run Code Online (Sandbox Code Playgroud)
但它不断抛出以下错误.
警告:include(tweets.php):无法打开流:第52行没有这样的文件或目录警告:include():无法打开'tweets.php'以包含(include_path =':')in-on第52行
我检查并仔细检查,文件肯定存在,并且与它所在的文件位于同一目录中.
我真的很感谢你的帮助.
我不确定这可以用纯CSS完成,或者我需要使用一些jQuery来做到这一点.
我有一个div(product_image),它在当前状态下距离顶部大约400px并且相对定位,因此它清除顶部菜单和标题,我需要做的是当用户向下滚动并从顶部到达大约20px时在div中,我需要div来固定.
这是我尝试过的,我有主要的div与相对定位然后我有另一个div包装内部固定定位.问题是div从顶部停留在400px.
这是代码:
<div class="product_image">
<div class="product_image_fixed">
<a href="products/1.jpg" class="zoom" title="A bed!" rel="gal1">
<img src="products/1.jpg" width="450" alt="" title="A bed!">
</a>
<ul id="thumblist" class="clearfix" >
<li><a class="zoomThumbActive" href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: 'products/1.jpg',largeimage: 'products/1.jpg'}"><img src='products/1.jpg' width="150" height="100"></a></li>
<li><a href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: 'products/1a.jpg',largeimage: 'products/1a.jpg'}"><img src='products/1a.jpg' width="150" height="100"></a></li> </ul>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
和CSS
.product_image {
position: relative;
float: left;
width: 450px;
margin-left: 10px;
margin-top: 10px;
}
.product_image_fixed {
position: fixed;
float: left;
}
Run Code Online (Sandbox Code Playgroud)
我希望我的问题足够清楚,我似乎无法找到解决方案,所以我提前感谢你的帮助!
我正在将WooCoommerce与WooCommerce订阅插件和Stripe一起使用。订阅按月收费,产品被发送给客户,然后客户决定是否保留商品并为其付款或退货。
如果他们不退货或付款,则系统需要能够从预订中存储的Stripe支付卡中扣除全部金额,将编写一个自定义插件来自动处理该问题。
症结在于能够对通过Stripe存储的卡进行收费。
解决此问题的最佳方法是什么?
我一直在搜索文档,但似乎找不到合适的钩子,因此正在寻求有关最佳方法的一些建议。
php wordpress stripe-payments woocommerce woocommerce-subscriptions
我试图从网址中包含一个文件,但是我得到了以下错误.
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /Applications/MAMP/htdocs/diningtime/testsite/salims/index1.php on line 58
Warning: include(http://localhost/diningtime/templates/100/index.php): failed to open stream: no suitable wrapper could be found in /Applications/MAMP/htdocs/diningtime/testsite/salims/index1.php on line 58
Warning: include(): Failed opening 'http://localhost/diningtime/templates/100/index.php' for inclusion (include_path='.:/Applications/MAMP/bin/php/php5.4.4/lib/php') in /Applications/MAMP/htdocs/diningtime/testsite/salims/index1.php on line 58
Test
Run Code Online (Sandbox Code Playgroud)
只是想知道周围是否有这个?
我的PHP包括代码
<?php include "$location/index.php"; ?>
Run Code Online (Sandbox Code Playgroud)
感谢您对此的帮助.
我的CSS UL菜单似乎不想中心,任何想法?我已粘贴下面的代码供您查看,我对CSS很新,所以非常感谢您的帮助:-)
我能够居中的唯一方法是通过固定宽度和使用html中心标签,但我需要菜单100%进行扩展,我需要自动居中.
CSS
#menu{
width:100%;
margin: 0;
padding: 5px 0 0 0;
list-style: none;
background-color:#333333;
text-align:center;
}
#menu li{
float: left;
padding: 0 0 5px 0;
position: relative;
list-style:none;
margin:auto;
}
#menu ul{
list-style:none;
display:inline;
margin: 0;
padding: 0;
text-align: center;
}
#menu a{
float: left;
height: 15px;
padding: 0 25px;
color:#FFF;
text-transform: uppercase;
font: 10px/25px Arial, Helvetica;
text-decoration: none;
text-shadow: 0 0px 0 #000;
}
#menu li:hover > a{
color:#F90;
font: bold 10px/25px Arial, Helvetica;
}
*html #menu …Run Code Online (Sandbox Code Playgroud) 所以我有一些CSS生成这个.

HTML代码如下.
<div class="menu">
<ul>
<li><a href='index.html'>Home</a></li>
<div class="menutab"></div>
<li><a href='about_us.html'>About Us</a></li>
<div class="menutab"></div>
<li><a href='#'>Order Online</a></li>
<div class="menutab"></div>
<li><a href='gallery.html'>Gallery</a></li>
<div class="menutab"></div>
<li><a href='#'>Contact Us</a></li>
<div class="menutab"></div>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
和CSS
.menu {
width: 100%;
height: 220px;
float: left;
margin-left: -20px;
position: relative;
text-align: center;
}
.menu li{
display: block;
list-style: none;
width: 100%;
background: #EBE5D9;
height: 50px;
margin-left: -40px;
margin-top: 5px;
line-height: 50px;
}
.menu li:hover {
background: #AEC32A;
}
.menu li a{
text-decoration: none;
font-size: 20px;
color: #000000; …Run Code Online (Sandbox Code Playgroud) 我是JQuery的新手,我试图在页面底部加载一个div,当页面加载时,然后当用户开始滚动时div需要淡出,然后在滚动回到顶部时重新出现.
我为淡化div而做的代码不起作用,可以在这里看到http://jsfiddle.net/DeZnT/
我正在使用的jQuery是
$(document).ready(function () {
$(function(){
$(".other_product_links").animate({bottom:'0px'});
});
});
Run Code Online (Sandbox Code Playgroud)
提前感谢您的时间和帮助.
我是 Swift 编码的新手,我一直在寻找解决此问题的方法已有一段时间,但目前还没有找到任何可以解决我的问题的方法。
我正在使用一个函数从 Firebase 返回一些数据。经过多次错误和大量研究,我设法使函数“工作”而不会引发错误,但返回的数据是空白的。本质上,当我调用函数时,我试图返回多个值并将它们保存在一个数组中。
数据从 Firebase 返回得很好,当我在设置变量后打印出变量时,它会正确打印出来,但是当我在返回函数之前执行相同操作时,它返回空白。如果我尝试在设置数据后立即返回该函数,则会收到错误“void 函数中出现意外的非空返回值”。
这是完整的代码:
func loadClientData(client_id: String) -> (address_1: String, address_2: String, city: String, company_name: String, contact_name: String, county: String, email: String, phone: String, postcode: String, country: String) {
let db = Firestore.firestore()
let userID : String = (Auth.auth().currentUser!.uid)
print("\(userID)/clients/existing/\(client_id)")
let docRef = db.collection("\(userID)/clients/existing/").document(client_id)
var address_1 = ""
var address_2 = ""
var city = ""
var company_name = ""
var contact_name = ""
var county = ""
var email = ""
var …Run Code Online (Sandbox Code Playgroud) css ×5
jquery ×3
php ×3
html ×2
swift ×2
css3 ×1
html-lists ×1
ios ×1
woocommerce ×1
wordpress ×1