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.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -