Home > front end >  Machinery industry workers and a get a div container in the position of the browser window JS code..
Machinery industry workers and a get a div container in the position of the browser window JS code..

Time:10-25

This. DOM. Pass reveal. Style. The top=` ${mousePos. Y + 20 - docScrolls. Top} px `;
This. DOM. Pass reveal. Style. Left=` ${mousePos. X + 20 - docScrolls. Left} px `; Is the mouse position, at present, and the other at sixes and sevens anyway, I do not understand
I am set up a mouse will pop up a picture of the function in the past, now he just follow the mouse position pop-up, I want him to fixed in a DIV x0, y0 position pop-up,
When I finished typing that I discovered what seems to be the only post this a few lines of code must not be able to achieve





When I finished the

CodePudding user response:

Position with absolute positioning
Show hidden can control the z - index or width or height or set the display

CodePudding user response:

. A far cry from what the basic theory, and to understand, but still thank you very much for your answer

CodePudding user response:

This. DOM. Pass reveal. Style. The top=` ${mousePos. Y + 20 - docScrolls. Top} px `;
This. DOM. Pass reveal. Style. Left=` ${mousePos. X + 20 - docScrolls. Left} px `;
1, which of the two above other commented,
2, the target div innerHTML assignment into image tag HTML
Such as Internet explorer can be used in the
Div. InnerHTML=this. DOM. Pass reveal. OuterHTML
To be compatible with jquery or write their own extensions, can have a better method to get the image tag HTML,
3, then
This. DOM. Pass reveal. Style. The display='block'

CodePudding user response:

I have already solved, thank you for your answer,
  • Related