Hey there I want to change the style of my entire website. For this, I want to switch the style sheet in react. How can I do this ?
I used jquery to solve this, but it didn't work in react.
$(function () {
$(document).ready(function () {
$(".navbar").show();
(function ($j) {
switch_style = {
onReady: function () {
this.switch_style_click();
},
switch_style_click: function () {
$(".style-changer").click(function () {
var id = $(this).attr("id");
$("#switch_style").attr("href", "css/" + id + ".css");
});
},
};
$j().ready(function () {
switch_style.onReady();
});
})(jQuery);
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 250) {
$(".navbar").fadeOut();
} else {
$(".navbar").fadeIn();
}
});
});
});
}(jQuery));