I am very new to JS and I would like to create a drop down when an image is clicked on. When it is clicked on the drop down should slide down to show some extra information and should stay down and keep the information displayed, then when another one of these tags are clicked that one that is down should slide back and the new one down.
Could you please tell me how to do this or give me some tutorial to do?
Thanks so much!
Here is an example: http://twitter.github.com/bootstrap/javascript.html#collapse
What you're looking for is called an accordion. Here is a fine tutorial I found that uses jQuery:
http://tutorialzine.com/2009/12/colorful-content-accordion-css-jquery/
Related
I'm having an issue when I try to implement a right-click inside of the tree nodes you can checkout my example in the link, the problem is basically that every time I try to click on the menu Items, my Select Dropdown gets close, please somebody Help me!
https://codesandbox.io/s/custom-dropdown-antd4152-forked-4lv9p?file=/index.js
Small Sample video GIF
I wanna make a button which shows two values hide and show. When we click the button hide it hides the content and it value changes to show and when we click show it displays the content.
I agree with previous comments. This is something typically taught in a tutorial. I was able to find an existing example in SO in less than 30 seconds. Hope this helps: https://stackoverflow.com/a/13652860/6288438
I've modified the code on several places now and I've come up with the following solution: jsfiddle.net/u2158392/2g8poyxh/
It's working pretty well, but I'm looking for a way to close the other dropdown menus which are still open when I'm clicking on another one.
So how can I make sure only one dropdown menu can be activated on the page at all times?
Thanks in advance!
I'm doing a project that consists of posting updates with photos, like facebook timeline. so i created this
So i need the code for the following:
When the POST button is clicked, make a new DIV on the top of last post on the timeline that is similar to facebook. and the DIV must consist of Input text and the image that i uploaded. when I browsed this topic I found similar thread jQuery create and remove <div> by click , but it creates divs one after another. I need just the opposite of that.
Any help will much appreciated.
Use prepend instead of append to put a new div on the beginning of a container:
http://api.jquery.com/prepend/
I suggest you to create a empty div were you want them to appear (id: #start) and everytime you whant to post something, you can use jQuerys after (eg:$("#start").after('<div>text and formating</div>');).You can see some more examples here: http://api.jquery.com/after/
I'm in the final stages of my project/homework, and I came across a little problem. My homework was to create three dynamically generated drop-down menus; however the third menu is not updating based on the choices of the second menu, rather it is creating another menu. The second menu updates correctly based on the choices of the first menu. Can someone tell me what's wrong? There is a JSFiddle demo in the comments. Thank you all!
The problem is that you are not removing div with id="heroes" before you create another one. Your call to removeSiblings(x); does not remove div#heroes because div#heroes is not a sibling of select#myTeams. For div#heroes to be a sibling of select#myTeams you have to append it to div#teams instead of to div#stepOne. You would have to change line 108 of your fiddle:
document.getElementById('team').appendChild(heroDiv);
This will fix your issue with updating the third menu by selecting in the second, but you will have a similar issue with the form that renders when the user selects from the third menu.