I have a problem with the snippet below : everything works perfectly when I press the button on the 1st page. But it tells me that “secondPageItems” is not defined when I press the button on the 2nd page. (here every thing works fine because it’s on the same HTML page) Even stranger, if I put “secondPageItems” and “secondPageHiden” above
Tag: jquery
How to make same buttons work independently HTML/jQuery
I’m making favorite buttons that saves them with localStorage in a different page. I added those favorite buttons to every paragraph. I don’t want to write a lots of same codes for each of them. The question is that, is there any way to make same buttons work independently and save their parent objects to another page. So far I’ve
Targeting textual data to a DIV on a web page?
I have a web page – index.html on a localhost webserver – split horizontally via DIV elements and a CSS stylesheet into upper / lower panes. Titles (hyperlinked to source HTML documents) appear in the upper split. Task 1. When I click a hyperlinked title, the output is targeted to a DIV on index.html. That is working well. Task 2.
Using the duration of mouse press for scrolling
I coded this: You need to click the buttons pretty often to navigate through this container. Is there a way to let it based on the duration of the mouse press? Like if you keep the mouse pressed, it continues constantly scrolling? And if you stop, it stops. Would be happy if someone could help me. Answer Here’s a working
Hide element if scrolled to maximum of container
I worked with this code: If you scroll horizontally to the end of the #text element, the gradient on the right side should be hidden. If you scroll to the left side again, the gradient should be shown again. Has anyone an idea how to program that? Answer You need to subtract the offsetWidth from the scrollWidth:
Browser go back to active div in previous page
I want to create a list of button where once clicked, it will shows the respective div as below. And in the div, there is a few links that user can click, and once they clicked the link and go back, it will bring them back to the previous div instead of the first default div. Codes as below. I
How to output all user inputs at once by the user clicking a button at the bottom of the form
I’m making an HTML form and am fairly new to all of this. I want to ask the user different questions in a form using drop-down box and textarea. After the user selects/types in all their answers, I want to be able to make a button at the bottom where the user will click it and it will display all
jQuery anchor links toggling a menu?
I used jQuery to make a toggle menu where someone can click on different span titles to toggle between different containers of content (on the website, this toggle menu toggles between different contact forms). The menu works, but I am trying to make it so that if a user clicks an anchor link on a different page, they will be
Disable a function for a specific time
I currently have a function that scans a barcode or QR code and returns the result: It works great but the problem i have is that it scans the code very fast and multiple times. Is there a way to timeout the function so it only return the scans every second? Answer First of all, thanks for all the answers
Jquery Datepicker: date format is not working?
I am trying to display date in dd/mm/yyyy and the value should be store as yyyymmdd in a variable. dd/mm/yyyy is displayed correct but the value is not storing in format yyyymmdd it is showing as yyyymd like if I select 02/03/2022 it is storing as 202232 which is incorrect as it has to be store as 20220302. Answer You