javascript – Store "scroll" in LocalStorage

When the user clicks a particular button, the scroll position of an item changes. I would like this action to be stored in LocalStorage, but I do not know how to do it … can you help me?

Here is my script:

$ (& # 39; .btn.parteum & # 39;). click (function () {
$ (# Textarea #); animate ({scrollLeft: 0}, 400);
returns false;
});
$ (& # 39; .btn.parte2 & # 39;). click (function () {
$ (# Textarea #); animate ({scrollLeft: 140}, 400);
returns false;
});

jquery – Change the style / theme of the site and store it in LocalStorage

I have a theme change system on my blog, however, it has some problems, like, it can not change the style of a div.class added by jquery (addclass) or pseudo-elements (after / before / active, etc.) all disorganized !!

I am looking for a new way to proceed (OR A SOLUTION, if it exists) and I will love it if you give me suggestions …

Simplified example of my current system in JSFiddle: https://jsfiddle.net/ybocfr7n/1/

I'm showing how it works, by changing the style of the item, by recording it in local storage and indifference when trying to change the theme of the item. 39, an element: after.

Thank you so much 😉

Check if specific content exists in the localStorage

I need to check inside the beautiful ID's there is a specific number, so that I can update or add

carObjListaAnexos
(2) ["{"id":"1","src":"data:image/octet-stream;base64,/9…REBERAREQEREBERAREQEREBERAREQEREBERAREQEREH/9k="}", "{"id":"2","src":"data:image/octet-stream;base64,/9…AiIgIiICIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIg//Z"}"]
0: "{" id ":" 1 "," src ":" data: image / octet-stream; base64, / 9 "
1: "{" id ":" 2 "," src ":" data: image / octet-stream; base64, / 9 "
length: 2
__proto__: Table (0)