How to dynamically change themes after clicking a drop down menu of themes

前端 未结 6 1164
甜味超标
甜味超标 2020-12-12 18:01

I\'m using bootstrap for the interface of the website I\'m developing. I am also planning to integrate the bootswatch themes to my site. I have created a dropdown menu conta

6条回答
  •  暖寄归人
    2020-12-12 18:58

    you can try something like this

    html:

    
    

    javascript:

    function setTheme(themeName) {
        $('#theme-sheet').attr({ href: "https://bootswatch.com/slate/bootstrap.min.css" });;
    }
    

    where in the setTheme function will be called from your desired source such as dropdown or button.

提交回复
热议问题