gpt4 book ai didi

php - 检查 php 变量的 Jquery 覆盖

转载 作者:行者123 更新时间:2023-11-28 10:20:18 24 4
gpt4 key购买 nike

我有来自 JQuery 的这个脚本。

<script> 

// create custom animation algorithm for jQuery called "drop"
$.easing.drop = function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
};


// loading animation
$.tools.overlay.addEffect("drop", function(css, done) {

// use Overlay API to gain access to crucial elements
var conf = this.getConf(),
overlay = this.getOverlay();

// determine initial position for the overlay
if (conf.fixed) {
css.position = 'fixed';
} else {
css.top += $(window).scrollTop();
css.left += $(window).scrollLeft();
css.position = 'absolute';
}

// position the overlay and show it
overlay.css(css).show();

// begin animating with our custom easing
overlay.animate({ top: '+=55', opacity: 1, width: '+=20'}, 400, 'drop', done);

/* closing animation */
}, function(done) {
this.getOverlay().animate({top:'-=55', opacity:0, width:'-=20'}, 300, 'drop', function() {
$(this).hide();
done.call();
});
}
);

$("img[rel]").overlay({
effect: 'drop',
mask: '#789'
});
</script>

现在,我只需单击图像即可。然后覆盖层就会出现 div 中的所有内容。不过,我想点击图像,然后让覆盖层在 PHP 中出现 if 语句。任何想法...我不太擅长 js。

编辑:

是的,我正在使用 JQuery 插件 Easing。然而,覆盖效果很好......并且覆盖通过单击具有 rel 属性的图像来工作,如下所示

<img src="http://farm4.static.flickr.com/3651/3445879840_7ca4b491e9_m.jpg" rel="#mies1"/>

但是我不想点击图像,我希望它自动出现。

最佳答案

<?php if ($whatever) { ?>
$(document).ready(function() {
$("img[rel]").click();
});
<?php } ?>

关于php - 检查 php 变量的 Jquery 覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5785244/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com