我试图根据是否设置了某些会话变量来动态定位html元素。我的代码如下:
<?php if(!empty($_SESSION['fromARPE'])) : ?>
<script>
document.getElementById("provenance").style.top = "80%";
</script>
<div style="font-size:30px;">Provenance / <br/> Provient de ARPE : </div>
<div style="position:absolute;left:40%;font-size:70px;" id="provenance"><?=$_SESSION['fromARPE']?></div>
<div style="border-bottom:1px solid black; margin-left:35%; width:70%;"></div>';
<?php endif; ?>
可以这样做吗?如果是这样,我错过了什么?
谢谢
答案 0 :(得分:2)
是的,没关系,你只需纠正一些错误,请参阅下面的代码:
self.caDisplayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(displayLinkCalled:)];
caDisplayLink.preferredFramesPerSecond = 120;
NSLog(@"Maximum FPS = %ld", [UIScreen mainScreen].maximumFramesPerSecond);
[caDisplayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];