copy given elements to another div
let's take this image:
- <li class="mix shoulders check1 radio1 option1"><img src="images/exercises/shoulders/Single-Arm Linear Jammer.jpg" alt="Image 1"></li>
I am getting it by this function:
- $(function(){
- /* elements is a name that preceding the selectors.
- get all img tags found inside li tags and fire the function.
- Then bind to the elem-msg div (which is inside the info_box) the elemText value.
- */
- $('.elements li img').click(function(){
- $('.body-inactive').show();
- $('.info_box').fadeIn(2000); // The info_box hidden using the css, this line of js is telling that, if the img is being clicked, the info_box should be visible(fadeIn) with a transition of 2000ms.
- elemText = $(this).attr('data-text');
- elemSrc = $(this).attr('src'); //Getting the img src (to be viewed in the info_box).
- $('.info_box .exercise_img').attr('src',elemSrc); // get the value (image) of the src tag that the function gets from the html code.
- //elemId = $(this).attr('id');
- $('.info_box .elem-msg').html(elemText);
- //$('.info_box input[type="hidden"]').attr('id',elemId);
- })
- })
- </script>
Now - I want to get the image given by this function , and pass it to a function , so I could show the image in another div. How do I do that?