Isterklister Posted April 12, 2011 Share Posted April 12, 2011 Hello, I'm trying to get a drop down list (ordinary html function, select option ...) but I want it to start from an image. When you click the image I want the drop down list to appear. Hove can I do this? /Pelle Quote Link to comment https://forums.phpfreaks.com/topic/233476-drop-down-list-from-image/ Share on other sites More sharing options...
anupamsaha Posted April 12, 2011 Share Posted April 12, 2011 Two possible ways are ther: 1. Create the option list inside a DIV with an unique ID and make it non-visible (style="display:none") when you render the page. Then define a click event on the image and through JavaScript show the DIV (style="display:block") 2. Create a blank DIV. And on click event for the image in JavaScript, call a script through AJAX that will generate the list and pass back to the Ajax calling point. Then after Ajax success, you can set the "innerHTML" of the DIV with the returned HTML from Ajax. Hope this helps. Thanks! Anupam Quote Link to comment https://forums.phpfreaks.com/topic/233476-drop-down-list-from-image/#findComment-1200608 Share on other sites More sharing options...
Isterklister Posted April 12, 2011 Author Share Posted April 12, 2011 Thanks, version 1 look perfect for the job and I will test it. Quote Link to comment https://forums.phpfreaks.com/topic/233476-drop-down-list-from-image/#findComment-1200723 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.