After creating a one-page portfolio website with two main stylesheets (default in green and an additional one in red), I am now looking to implement two buttons that allow users to switch between the stylesheets without the need for page reloading.
You can view a demo of this feature on the demo site, and I want to replicate the same functionality on my own website.
Although I have implemented the code provided below, it seems that when I click on the icon, it does not expand as expected just like the demo site. Here is the HTML markup used:
<div class="theme-settings">
<a href="javascript:;" data-click="theme-settings-expand" class="theme-collapse-btn"><i class="fa fa-cog fa-spin"></i></a>
<div class="theme-settings-content">
<ul class="theme-list clearfix">
<li class="active"><a href="javascript:;" class="bg-green" data-theme="default"></a></li>
<li><a href="javascript:;" class="bg-red" data-theme="red"></a></li>
</ul>
</div>
</div>
The CSS code used for styling the button is as follows:
.theme-settings .theme-collapse-btn {
position: absolute;
/* Additional styling properties */
}
/* More CSS code for different elements */
.bg-red {
background: #d93240!important
}
.bg-green {
background: #5bb12f!important
}
If you have any suggestions on how to resolve this issue or know of a free plugin that can achieve the desired functionality, please let me know. Thank you in advance.