Make content visible only after using jquery to copy html content

Sarah cartenz

I have something like this:

$(".mini-circle").hover(function() {
  $("#circle").html($(this).html())
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<button class="mini-circle" style="background-color:#A9A9A9">circle
  <ul visibility: hidden>
    <li><b>Indecision:</b> Gray prefers to sit in the middle, not making a decision either way, sitting on the fence.</li>
    <li><b>Detached:</b> being non-emotional, gray can appear indifferent, uncaring, cold and aloof.</li>
    <li><b>Unemotional:</b> gray can appear neutral, disinterested, objective or impartial.</li>
  </ul>
</button>

<div class="row">
  <div id="circle" style="background-color:red" align="center">
  </div>
</div>

Notice that the <ul> is not visible. I use:

to copy that <ul> html section into the lower div. However nothing is visible because it is copied as it is.

$($(this).attr('visibility', 'visible')).html() 

but it is no use. I also tried many other things but the branching is confusing. Do you have any idea how I can tackle this?

Simply Me

Got this working, if this is what you expect (this is what I understand). You need the <ul> to become visible on button hover.

<!DOCTYPE html>
<html>

<head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  <script>
    $(document).ready(function() {
      $(".mini-circle").hover(function() {
 	  $("#circle").html($(this).html());
          $("ul").css("visibility","visible");
      });
    });
  </script>
</head>

<body>


  <input type="button" class="mini-circle" style="background-color:#A9A9A9" value="circle">
  <ul style="visibility:hidden">
    <li><b>Indecision:</b> Gray prefers to sit in the middle, not making a decision either way, sitting on the fence.</li>
    <li><b>Detached:</b> being non-emotional, gray can appear indifferent, uncaring, cold and aloof.</li>
    <li><b>Unemotional:</b> gray can appear neutral, disinterested, objective or impartial.</li>
  </ul>

  <div class="row">
    <div id="circle" style="background-color:red" align="center">
    </div>
  </div>
</body>

</html>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

jquery copy html content without the child content

From Dev

Make content visible after PayPal payment?

From Dev

Wrapping only the visible content

From Dev

How to make some content visible only to admin/mod users

From Dev

Make email body content parts visible only to specific BCC recipient

From Dev

Using JQuery on $.html inserted content?

From Dev

Change HTML content using jQuery

From Dev

Make innosetup copy the full folder instead of only its content

From Dev

jquery get visible html div content loaded by ajax?

From Dev

Using Toggle() to show an HTML content using jQuery

From Dev

Adding html content after an element using css

From Dev

Get Html Content from xml using jquery

From Dev

How to append HTML content using Jquery

From Dev

Changing html content using if statement and jquery

From Dev

Copy content from <td> into a text box using jQuery

From Dev

jQuery ~ copy content from div to div using .next('div')

From Dev

copy table or div content on button click using jquery

From Dev

render only the content on a page that is currently visible

From Dev

display html content only once after user signed in

From Dev

display html content only once after user signed in

From Dev

how to make content to be fixed inside scroll div using only css?

From Dev

how to make content to be fixed inside scroll div using only css?

From Dev

jQuery to return the wrapper of the content instead of only the content

From Dev

Make container fill only by content

From Dev

using the .load() to copy dynamic content

From Dev

Using declarativeContent permission, hide pageAction after content change using jQuery

From Dev

Make javascript load after content

From Dev

jQuery: Only show content that is visible from current view and load the rest on scrolling

From Dev

Split layout for HTML screen, content below not visible

Related Related

  1. 1

    jquery copy html content without the child content

  2. 2

    Make content visible after PayPal payment?

  3. 3

    Wrapping only the visible content

  4. 4

    How to make some content visible only to admin/mod users

  5. 5

    Make email body content parts visible only to specific BCC recipient

  6. 6

    Using JQuery on $.html inserted content?

  7. 7

    Change HTML content using jQuery

  8. 8

    Make innosetup copy the full folder instead of only its content

  9. 9

    jquery get visible html div content loaded by ajax?

  10. 10

    Using Toggle() to show an HTML content using jQuery

  11. 11

    Adding html content after an element using css

  12. 12

    Get Html Content from xml using jquery

  13. 13

    How to append HTML content using Jquery

  14. 14

    Changing html content using if statement and jquery

  15. 15

    Copy content from <td> into a text box using jQuery

  16. 16

    jQuery ~ copy content from div to div using .next('div')

  17. 17

    copy table or div content on button click using jquery

  18. 18

    render only the content on a page that is currently visible

  19. 19

    display html content only once after user signed in

  20. 20

    display html content only once after user signed in

  21. 21

    how to make content to be fixed inside scroll div using only css?

  22. 22

    how to make content to be fixed inside scroll div using only css?

  23. 23

    jQuery to return the wrapper of the content instead of only the content

  24. 24

    Make container fill only by content

  25. 25

    using the .load() to copy dynamic content

  26. 26

    Using declarativeContent permission, hide pageAction after content change using jQuery

  27. 27

    Make javascript load after content

  28. 28

    jQuery: Only show content that is visible from current view and load the rest on scrolling

  29. 29

    Split layout for HTML screen, content below not visible

HotTag

Archive