小编nic*_*cky的帖子

yii2导航小部件子菜单类

我使用adminLTE主题进行bootstrap,它使用treeview-menu类来操作子菜单.

<?=Nav::widget([
            'options' => ['class' => 'sidebar-menu treeview'],
            'items' => [

                ['label' => 'Menu 1', 'url' => ['/a/index']],
                ['label' => 'Menu 2', 'url' => ['/custom-perks/index']],
                ['label' => 'Submenu',  'items' => [
                    ['label' => 'Action', 'url' => '#'],
                    ['label' => 'Another action', 'url' => '#'],
                    ['label' => 'Something else here', 'url' => '#'],
                    ],
                ],
            ],
        ]);
        ?>
Run Code Online (Sandbox Code Playgroud)

我试过用: ['label' => 'Submenu', 'options' => ['class' => 'treeview-menu'], 'items' =>..

这显然不起作用.

我注意到Menu :: widget有一个,submenuTemplate但是当我使用它时它停止了拾取"活动".

有没有办法我可以改变adminLTE调用应用于treeview菜单的方式(尝试将它在app.js中更改为下拉菜单但没有帮助)或重新分配UL子菜单类而不进入供应商代码?

第65行:\ yii\bootstrap\Dropdown - …

css themes nav twitter-bootstrap yii2

10
推荐指数
1
解决办法
2万
查看次数

-ms-filter with javascript

如何在javascript中实现-ms-filter?

我尝试了以下不起作用:

document.getElementById(ba[i]).style.sFilter = 
      'progid:DXImageTransform.Microsoft.Alpha(Opacity=' + value*10 + ')';
Run Code Online (Sandbox Code Playgroud)

另一个问题.如果我想更改元素的字体颜色,我使用了以下内容(除了IE8之外的所有内容都有效):

document.getElementById(ba[i]).style.color = '#B4D8FD';
Run Code Online (Sandbox Code Playgroud)

html javascript css internet-explorer-8

2
推荐指数
1
解决办法
4861
查看次数

jquery/ajax设置charset标头

我试图在一个jquery调用中设置charSet我正在制作的网站是一个立陶宛朋友,因此有一些带有重音符号的字母等.

至于我迄今为止的研究(2天值得!!!)已经显示,我需要将它放在beforeSend部分,我已经完成如下:

     $(document).ready(function(){
 $('.content').load('home.html');   //by default initally load text from boo.php
     $('#navlist a').click(function() { //start function when any link is clicked
                    $(".content").slideUp("slow");
                     var content_show = $(this).attr("title"); //retrieve title of link so we can compare with php file
                        $.ajax({
                        method: "load",url: ""+content_show,
                        beforeSend: function(){
                            XMLHttpRequest.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
                            $("#loading").show("fast");
                        }, //show loading just when link is clicked
                        complete: function(){ $("#loading").hide("fast");}, //stop showing loading when the process is complete
                        success: function(html){ //so, if data is retrieved, store it in html
                        $(".content").show("slow"); //animation
                        $(".content").html(html); //show …
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery

1
推荐指数
1
解决办法
2万
查看次数