Easyui Switch Themes

Source: Internet
Author: User

Easyui 1.4.2: Click to open the link topic there are more than 10

jquery Cookie: Click to open Link first the page must first import Easyui Related:
Related interface, I defined a toggle theme for the
 <div style= "POSITION:ABSOLUTE;RIGHT:14PX;TOP:42PX;" > <div class= "Easyui-panel" style= "padding:5px;font-size:20px;font-weight:900;" > <a href= "javascript:void (0);" class= "Easyui-menubutton" data-options= "menu: ' #layout_north_pfMenu ', icon Cls: ' Icon-ok ' "> Replace skin </a> </div> </div><div id=" Layout_north_pfmenu "style=" Displ Ay:none; " > <div onclick= "changetheme (' Default '); >default</div> <div onclick= "Changetheme (' black '); >black</div> <div onclick= "changetheme (' Bootstrap ');" >bootstrap</div> <div onclick= "Changetheme (' Gray '); >gray</div> <div onclick= "Changetheme (' metro '); >metro</div> <div onclick= "changetheme (' Metro-blue ');" >metro-blue</div> <div onclick= "changetheme (' Metro-gray ');" >metro-gray</div> <div onclick= "changetheme (' Metro-green ');" >metro-green</div>       <div onclick= "Changetheme (' metro-red ');" >metro-red</div> <div onclick= "changetheme (' Metro-orange ');" >metro-orange</div> <div onclick= "changetheme (' Ui-cupertino ');" >ui-cupertino</div> <div onclick= "changetheme (' ui-dark-hive ');" >ui-dark-hive</div> <div onclick= "changetheme (' Ui-pepper-grinder ');" >ui-pepper-grinder</div> <div onclick= "changetheme (' Ui-sunny ');" >ui-sunny</div> </div>

JS in I wrote Changetheme this method:
/** * method of changing Easyui Theme * @param themename * Theme Name */changetheme = function (themename) {var $easyuiTheme = $ (' #easyuiTheme '); VA R url = $easyuiTheme. attr (' href '); var href = url.substring (0, Url.indexof (' themes ')) + ' themes/' + themename + '/easyui.cs s '; $easyuiTheme. attr (' href ', href), var $iframe = $ (' iframe '), if ($iframe. length > 0) {for (var i = 0; i < $iframe. l Ength; i++) {var IFR = $iframe [i];$ (IFR). Contents (). Find (' #easyuiTheme '). attr (' href ', href);}} $.cookie (' Easyuithemename ', ThemeName, {expires:7});};
MainThe principle of implementation is to change the import CSS file, so that you can switch themes

Easyui Switch Themes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.