search

Home  >  Q&A  >  body text

javascript - How to adjust the position of the canvas tag in h5 to be different after hiding and displaying it again?

Use the canvas tag dynamically added by js to draw some lines, and use absolute positioning at a specific location. It is displayed by default, but the product requires that it can be hidden, so I made a button that can be hidden or displayed after clicking it. When using hide() and show(), why is the position of the canvas incorrect after hide() and then show()?

巴扎黑巴扎黑2745 days ago994

reply all(1)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-24 11:39:35

    The problem of positioning the parent. Do not position the body or other higher parents. It is best to position the parent. If you cannot return to the previous position, it must be because the view layer has changed! Don’t blame me if I get the answer wrong. Corrections are welcome

    reply
    0
  • Cancelreply