Save menu current position - javascript

I have a website where I have a drop down menu, i.e. the main category, sub-category and sub-category of the 2nd level. After selecting the sub-category 1 or 2 level, the identifier of the clicked sub-category is saved to localStorage.
My problem is that after switching to another subpage, the entire menu is curled up, and now I would like the menu to expand to the level of the subcategory that I clicked after entering the new subpage. Unfortunately, I have no idea how to do it :(
My code: jsfiddle.net/reverse26/4z93kv1n/2/
When you select a sub-category, localStorage is updated and the last-clicked sub-category is saved in it. You can check it yourself by going to the website. My menu is created dynamically in Symfony

The solution to my problem was to save the last category/subcategory identifier to localStorage and each time the page was loaded, to check which category/subcategory was last clicked, on this basis js changed the display:none of this block to display:block

Related

Vue Js Problem with the location of the page

I am making a one-page application in restaurant menu style with Vue Js, so I switch between components without refreshing the page. There are categories on the home page. And when these categories are clicked, products belonging to that category appear. The problem I'm having is: For example, if there are 5 categories, these categories are listed at the bottom on mobile and not all of them are visible on the screen, so the user has to scroll down to see other categories. When he clicks on a category below, the products page that opens is not at the top of the page. In other words, the products in the page position of the clicked category appear. The first items are not showing up. I hope I was able to explain my problem. How can i solve this problem. Thank you from now.
I clicked on a category at the bottom of this picture.
Normally, the product at the top of the page should appear like this.
but when the page is opened for the first time, a product appears in the middle of the page.

How do I make the sub items selectable particular under Accordion in react-native?

I'm making custom Accordion with custom sub items as radio buttons. As you can see, I already create the accordion but stuck in selection of the sub item.
The issue is the when I select one item then all sub-items under that main accordion tab are selects. I want the particular one should be selected when select and the default the first one should be selected when anyone comes to this page like as first accordion tab is expanded and first sub-item should be selected.
Please help me. Below is the full code expo link mentioned:
https://snack.expo.dev/#john.ocean/crabby-churros
Screen shot of the issue is below:
checkout the updated code here : https://snack.expo.dev/T1q7WFzPP
Had some issues with the logic of your subcategory item selection. And thanks for providing expo link.

Oracle APEX - Put onclick event on tabs of tabs container

I've got a tabs container with three tabs. They have select lists and checkboxes on them which have sql queries as source. Users can select entries in the lists or edit the checked boxes and save this to the database by clicking a button. This button also re-fills the select lists and checkboxes with the current data from the database after saving it.
My problem is: When a user selects an entry in a select list or edits a check box and navigates to antoher tab without clicking on the "save" button, the data stays there when navigating back to the tab. I want to assure that what is depicted in the lists and check boxes is always the current data like it is in the tables in the database.
Therefore, I tried to put an onclick event on the tabs of the tabscontainer like this one:
I didn't get it to work, becuase these elements do not have an ID and I can not set an ID for them in APEX (at least I guess so). Is there a way to do this in APEX anyway?
This is one of the tab elements:
You can put a static ID to your tab region (for example #SOME_STATIC_ID) and then select the elements with a jQuery selector:
$("#SOME_STATIC_ID a.t-Tabs-link")
You could also define an on click listener on text of the tab:
$(".t-Tabs-label:contains('Tab 1')").click(function(){alert('Doing something on click of Tab 1 !!!')});
It might not be the cleanest solution but it works.
Just in case anyone else is experiencing the same problem: I solved it by putting an custom dynamic action on the tabs container:
This fires whenever the user switches between the tabs and ehrefore worked for me :-)
For more information check this article: https://medium.com/#pierre.yotti/tabs-region-javascript-api-in-oracle-apex-37e20bc9f68f

Linking to page with auto-click for a specific category (out of multiple) - JavaScript and CSS

I have developed a page that lists a bunch of divs, each containing some text content. At the top of the page are some buttons that allows me to filter which divs I want to view, based on a data-category. For example: I have listed all schools (all grade levels) at a school district, each in their own divs. When I click the 'Show High Schools' button, only the high school divs display below.
The filtering functionality works fine, but I'd like to be able to link to this page via another page and have the page auto click the appropriate category. I know how to setup an auto click for one button on page load. But what I'm trying to do is auto click a button depending on a specific category. So for example: I have a homepage that has the buttons 'High Schools', 'Middle Schools', and 'Elementary Schools'. When the user clicks the 'Middle Schools' button, they are taken to my filtering page, with only the Middle Schools being displayed. They can then click a 'Show All' button to reset the filtering system if needed.
Live Link
Again, the filtering works fine. I just don't know how to have links go to this page with an auto-click setup depending on category.
You can use query params "ex: www.example.com/?category=high-school" redirect to another page and using the query params to display the required contents. It would be great if there is a code to view and help you out

Magento Category not displaying on home page

Had to change "Cameras" to "Digital Cameras", copied the exact same settings as i had in the "Cameras" in the category attributes and now on my homepage the first category towards the middle of the page will not display, so i put everything back to the way it was and still won't show
link:
http://47stphoto.simple-helix.net/index.php
yet all the others with the same settings still do?
Check the status(Include in Navigation Menu) of the new category is set to yes.
Check Include in Navigation Menu is set to yes?

Categories

Resources