-3

I just have a quick question, i want to implement a floating menu when i click on a text or a word using jQuery or javascript whats the best way to do that ?

Walid
  • 73
  • 1
  • 1
  • 9
  • Have you tried anything to achieve this effect? Do you have any code samples or failed attempts at creating this? We could probably help with that since SO is about helping fixing things not requesting one to do it for you – Pankucins Oct 20 '14 at 10:44
  • Did you try something? Do you have some example to show us? Your question is pretty generic, it is not easy help you. – Marco Mercuri Oct 20 '14 at 10:46
  • I just googled "jQuery popup menu" and this is the first thing that came up: http://stackoverflow.com/questions/1328723/how-to-generate-a-simple-popup-using-jquery – Calvin Scherle Oct 20 '14 at 10:46
  • Before you close my question or rate it down i didnt ask anyone for a code i just wanted a short description or idea of how to implemenet is i.e what to use a div or something else. Thank you anyways – Walid Oct 20 '14 at 10:59

1 Answers1

2

You want to do something like:

$(" #elementToClick" ).click(function() {
  $(" #elementToShow" ).show();
});

Obviously you would want a method to hide it also, but once you get the show running, that should be trivial. Please note, that in order for "show()" to work, the element must have the "display" value set in CSS, like

#elementToShow {
  display: block;
}

documentation for the show() function in jQuery can be found here. You can find documentation for all things the API exposes there, for future reference.

Kristian
  • 278
  • 2
  • 6
  • @Walid If you like the answer, you can indicate this by pressing the up-arrow next to the answer. You can even accept my answer as the best answer if you like, which will mark your question as having an accepted answer. This might help other people finding your question if they are trying to find an answer for the same problem. – Kristian Oct 20 '14 at 11:27