Answer the question
In order to leave comments, you need to log in
How to prevent the browser from scrolling the page to the place from which it went to another page when returning to the previous page?
I have Ajax loading of goods on my site, I need that when I go to the product card and return from it back, the browser does not try to scroll the page to the place where the transition was made (anyway, because of Ajax loading of goods, nothing will work) is it possible how do i stop the browser from doing this?
Answer the question
In order to leave comments, you need to log in
element.style.backgroundColor returns result as 'rgb(red,green,blue)'
Must be converted to hex first
function rgb2hex(rgb) {
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
function hex(x) {
return ("0" + parseInt(x).toString(16)).slice(-2);
}
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
}
color = color.indexOf("rgb") !== -1 ? rgb2hex(color) : color;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question