我添加了一个iframe,它在所有浏览器和一些设备上工作正常但在iphone 6中.iframe没有响应.它不适合100%的iPhone屏幕尺寸.
我在网上找到了很多解决方案,但大多数都展示了如何在iphone中制作iFrame滚动.我不需要那个.我想让它响应并根据屏幕大小进行调整.
<div class="frame-container" style="position: relative; padding-bottom: 65.25%; padding-top: 30px; height: 0;">
<iframe id="frame" width="100%" height="1000px" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe >
</div>
Run Code Online (Sandbox Code Playgroud)
我在上面的示例中删除了iframe中的src =""
从屏幕截图中可以看出iframe没有响应并且出现水平滚动.在加载过程中,iframe是根据设备视口进行的,但是一旦完全加载,iframe将获取整个宽度并显示水平滚动.
检查浏览器堆栈
我正在创建一个小的滑出菜单,而不使用任何库.通过使用UIDynamics,我可以通过单击IBAction按钮来滑动打开菜单.
我想问一下如何通过点击相同的btn来关闭菜单.可以通过单击另一个btn关闭菜单,例如菜单幻灯片中的"关闭"btn,但我也想通过单击打开它的同一菜单btn关闭它.
这是显示菜单的功能
-(BOOL)showMenu:(BOOL)yesNO{
//cleaning the screen of any behaviors
[self.animator removeAllBehaviors];
//animation will go from side to side
CGFloat graxityDirectionX = (yesNO) ? 0.1 : -1.0;
//detecting the collision of the menu
CGFloat collision = (yesNO) ? menuWidth : -menuWidth;
//insitating the gravity and telling it work on the menu
UIGravityBehavior *gravity = [[UIGravityBehavior alloc] initWithItems:@[self.menuView]];
gravity.gravityDirection = CGVectorMake(graxityDirectionX, 0);
//adding the animation
[self.animator addBehavior:gravity];
//instaniating the collision and telling the menu were to stop
UICollisionBehavior *collisionMenu = [[UICollisionBehavior …Run Code Online (Sandbox Code Playgroud)