How to make an on click collapsible list using html and CSS - html

when i click on the arrow or the name the list drops down
this is how the expanded list looks like
how do I get this type of collapsible list using html and CSS
I tried it with details and summary tags but it puts the list further away from the other normal lists is there any other way to achieve it.

The question is already answered on stackoverflow and on the internet. Make sure to do some research before asking.
Here are some links: 1. Link 1
2. Link 2
You can take some ideas from these two and make your own custom dropdown.

Related

How to hide and show sections in jquery?

I'm trying to create a quiz game with 4 questions and a result page using jQuery with multiple answer that apply to a question with score and number of correct answers attempted. Each section is shown based on the click event
For testing I added the dummy code in JSfiddle: https://jsfiddle.net/Johnny_blake/7c2965oe/3/
The issue is that the sections are not shown or hidden properly while clicking on next and user experience is really bad, for reference I followed this fiddle: http://jsfiddle.net/fiddleyetu/DUNK9/2/
I added the sections to be hidden on start of the quiz:
$(document).ready(function() {
$(".questionOne").hide();
$(".questionTwo").hide();
$(".questionThree").hide();
$(".questionFour").hide();
$(".questionOne_correct").hide();
$(".questionTwo_correct").hide();
$(".questionThree_correct").hide();
$(".questionFour_correct").hide();
$(".questionOne_incorrect").hide();
$(".questionTwo_incorrect").hide();
$(".questionThree_incorrect").hide();
$(".questionFour_incorrect").hide();
});
Problems noticed:
The above classes do not properly show or hide in the sections, for
instance, when the answer is correct, on click of the button
(g4next) works fine, but incorrect answer with button (g4next) does
not move to the next section.
The input is not hidden as I'm making the image act as the checkbox, on click with ::after a tick is added but it is not working.
Things to be added:
How can I add the score with percentage i.e., 25% for each
questions and number of correct answers in text.
A progress step bar on each question section.
How can I make this to work as a dynamic quiz?

Showing different text on dropdown selection vs dropdown options

I have a requirement where my drop-down values in my select are an expanded div which has 3 lines. For example my options Could be something like below
Honda Accord
19'
Blue
--------------
Honda Civic
17'
Red
This is what my dropdown would look like when expanded. So instead of regular one line option I have a div with more detailed options. The challenge I am facing is when making my selection (I can correctly display the grid as above) my dropdown selection value shows as the context of the whole div. So for example my dropdown after selection would look like this.
[Honda Civic17'Red]
I am using Angular Material for my dropdown. Is anyone aware of a way to set the selection to another value than the option text? For example I would like my dropdown when selected to display [Honda Civic] instead of [Honda Covic17'Red].
Any help would be appreciated.
Thank you.
You can customize the display of the selected item using MatSelectTrigger. An example is provided here: https://material.angular.io/components/select/overview#customizing-the-trigger-label.

Making a TabNav work correctly

commerce site that has a particular tab navigation code that allows users to click and view information.
The Tab Nav looks like this:
Details | Shipping | Returns | Lifestyle View
When you click on anyone of these a paragraph appears below the tab with more information. What happens though is that all the other list items get pushed below the paragraph rather than staying in their current positions. So for instance if I click on "Details," the "Shipping," and "Returns," tab gets pushed down. I would like all the menu items to stay intact and just have the paragraph appear below each menu.
Any help would be greatly appreciated.
the page can be found at:
http://babsandmickieco.myshopify.com/collections/clothing-all/products/sana-dress#
As I've demonstrated in this JSFiddle, it really is a case of just appending an in flow element onto the list item. In the example I have provided, I used the following jQuery code to append a paragraph element (P) to a List item element (li).
Snippet
$("#clickAble").click(function(e) {
$("#clickList").append($("<p id='appended'>Hello</p>"));
});
As you can see, it's fairly obvious what his does. This created something of a rough example, but it's a working example nonetheless.

How to edit Wordpress menu to make a two-line menu?

I am trying to edit my wordpress page to make every menu item at the top of the page two lines long with the top line being a single word (ie: Home, About, etc.) and another line in a different font underneath each item (ie: "Read about us" underneath "About").
Here is an example of what I mean:
http://images.sixrevisions.com/2009/04/13-26_css_block_menu.png
I am aware that this is achieved in some way by using the 'Description' box on the Wordpress menu screen, and I have checked the 'show descriptions' box, but I'm unable to get it to display correctly.
Any help is greatly appreciated!
You do this by creating a custom walker which extends the Walker_Nav_Menu class - here's a good tutorial on it;
http://www.kriesi.at/archives/improve-your-wordpress-navigation-menu-output

Custom ComboBox with Horizontal line in DropDown

I want to create a Custom ComboBox in which the DropDown contains the Horizontal Line or you can say HRule immediate after the First Item. here I am providing you the image For that you can see i have used paint to draw the HRule i want component similar like that. Please provide me valuable Links or code for that. Here is the Image.
Thanks in Advance
Have # nice Day...
Here is your answer : How to add a separator to your ComboBox