javascript - position canvas on top of Scrollbar -
i simulation projectile motion path. i've 1 div css overflow property , curve drawn using canvas. want motion path appear @ top of everything. curve gets cut @ position scroll bar is. if change canvas z-index maximum or similar make canvas appear @ top scrollbar doesnt work... here jsfiddle demo of problem jsfiddle demo following javascript code: var canvas = document.getelementbyid('canvastron'); var context = canvas.getcontext('2d'); context.beginpath(); context.moveto(100, 150); context.lineto(350, 50); context.stroke(); is there way ??? if have no situation, go have mentioned, here solution . addition in css: #canvastron{position:absolute; clip: rect(48px, 351px, 151px, 99px);} with canvas, cannot scroll work effectively. occupy area of div below , not make scroll work. the provided solution has purely applied in case of worst case scenario, left no option , have under existing circumstances. otherwise, not possible. ...