How to implement text output in another block when you hover over the photo?

Hello!
've seen a lot of examples on this function and everywhere different you are doing.
How to properly implement this conclusion of the text when you hover over the photo without conflict?
I have the js code how to write or implement the text output to another block?
<div id="wrapper">
 <img src="img/1.jpg" alt>
 <img src="img/2.jpg" alt>
 <img src="img/3.jpg" alt>
 <img src="img/4.jpg" alt>
 <img src="img/5.jpg" alt>
 <img src="img/6.jpg" alt>
 <img src="img/7.jpg" alt>
 <img src="img/8.jpg" alt> 
 </div>

JS
var num = 8; // Number of images
 var wrapper = 200; // Size of the "canvas" for the location of the pictures
 var radius = 150; // Radius of our circle

 $(document).ready(function() {
 for (i=0;i<num; i++){ var f="2" num * i, math.pi; calculate the angle of each image in radians left="wrapper" + radius math.sin(f) 'px'; top="wrapper" math.cos(f) $('#wrapper img').eq(i).css({'top':top,'right':left}); Set values of the image } });< code></num;>
br><img src="https://habrastorage.org/webt/5b/50/7b/5b507be630ed1455859081.jpeg" alt="5b507be630ed1455859081.jpeg">
June 3rd 19 at 20:24
1 answer
June 3rd 19 at 20:26
Solution
Everything works fine! You can output the text wrapped in the tag

?

- cathryn.Bergstr commented on June 3rd 19 at 20:29
Yes , can data-text wrap in your tags what you want, but $('.textblock').text(text);
change to $('.textblock').html(text); - noe commented on June 3rd 19 at 20:32
How to wrap text without editing the html in the script to wrap it? - cathryn.Bergstr commented on June 3rd 19 at 20:35
, $('.textblock').html('<h1>' + text + '</h1>'); - noe commented on June 3rd 19 at 20:38
Hello!
Such a question is it possible to make so that this block of pictures was located in the center of the block ?
I tried to edit through css, but not working.
5b517ca2b34b9712730025.jpeg - cathryn.Bergstr commented on June 3rd 19 at 20:41
maybe you will throw a code example somewhere in compan or jsfiddle? - noe commented on June 3rd 19 at 20:44
Here all the same https://jsfiddle.net/1whpLuf4/
just changed the height of #wrapper height: 500px; - cathryn.Bergstr commented on June 3rd 19 at 20:47
Tried to change in the script this piece .css({'top':top,'right':left})
like the block moves along the edges of the block in the center can't do. - cathryn.Bergstr commented on June 3rd 19 at 20:50
It is not possible to place a block in the center? - cathryn.Bergstr commented on June 3rd 19 at 20:53
Hello! How to remove the inscription "undefined" appears when you refresh the page?
Appears when disappears the block when scrolling.
5b56adee0f8cf534991462.jpeg - cathryn.Bergstr commented on June 3rd 19 at 20:56

Find more questions by tags JavaScript