View unanswered posts | View active topics It is currently 2018-11-13 10:41



Reply to topic  [ 2 posts ] 
 点击画布,canvas自动和浏览器顶部对齐,挤掉我另外加在顶部的导航栏 
Author Message
新手上路

Joined: 2018-08-30 17:34
Posts: 1
Post 点击画布,canvas自动和浏览器顶部对齐,挤掉我另外加在顶部的导航栏
你好,我想到在网页顶部中加入一个导航。上面是导航,下面是画布,但是我一点击底下的画布,它就会和浏览器顶部对齐,导航被挤到标签栏后面遮住。不知道为什么?代码的话就是在试用的Demo里面加了一行,如下图。希望能尽快得到您的回复,谢谢

Attachment:
1.png
1.png [ 200.45 KiB | Viewed 145 times ]
Attachment:
2.png
2.png [ 220.29 KiB | Viewed 145 times ]
Attachment:
3.png
3.png [ 36.83 KiB | Viewed 145 times ]


2018-10-19 10:50
Profile
TWaver开发组
User avatar

Joined: 2018-04-16 16:11
Posts: 94
Post Re: 点击画布,canvas自动和浏览器顶部对齐,挤掉我另外加在顶部的导航栏
您好,采用您的添加方式,是会出现这样的问题的,因为我们做这个demo的时候,默认就是拿到网页的大小,然后设置上去的。

您如果想要在页面上方插入一个导航栏,必须要拿到包裹着canvas的父div,给他上方设置一定的空隙,留出导航栏的空间。采用下面这个api:

Attachment:
1540430.png
1540430.png [ 17.63 KiB | Viewed 98 times ]


2018-10-25 9:34
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: