admin管理员组文章数量:1022679
Using Materialize CSS within Laravel, and depending on certain situations I wanted to be able to disabled "Collapsible" elements, like you can easily with "Tabs" by adding the class of "disabled" should you need to, e.g:
<li @if(count($devices) == 0) class="tab col s4 disabled" @else class="tab col s4" @endif><a href="#mydevices">My Devices</a></li>
Tab Elements: MaterializeCSS Tabs
Collapsible Elements: MaterializeCSS Collapsible
But this doesn't work for collapsible elements. The workaround is just to hide the whole element but disabling shows the user what they potentially could get to where they to do more etc.
So this is the bit I'm trying to make disabled:
<div @if(count($devices) == 0) class="collapsible-header disabled" @else class="collapsible-header" @endif>My Devices</div>
Thoughts / Ideas appreciated :)
Using Materialize CSS within Laravel, and depending on certain situations I wanted to be able to disabled "Collapsible" elements, like you can easily with "Tabs" by adding the class of "disabled" should you need to, e.g:
<li @if(count($devices) == 0) class="tab col s4 disabled" @else class="tab col s4" @endif><a href="#mydevices">My Devices</a></li>
Tab Elements: MaterializeCSS Tabs
Collapsible Elements: MaterializeCSS Collapsible
But this doesn't work for collapsible elements. The workaround is just to hide the whole element but disabling shows the user what they potentially could get to where they to do more etc.
So this is the bit I'm trying to make disabled:
<div @if(count($devices) == 0) class="collapsible-header disabled" @else class="collapsible-header" @endif>My Devices</div>
Thoughts / Ideas appreciated :)
Share Improve this question asked Mar 25, 2016 at 13:50 WebTimWebTim 2476 silver badges11 bronze badges1 Answer
Reset to default 6I'm not a "Laravel" guy but I can propose you the following solution for HTML/JS/CSS:
<ul class="collapsible" data-collapsible="accordion">
<li class="disabled">
<div class="collapsible-header"><i class="material-icons">filter_drama</i>First</div>
<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>
</li>
<li>
<div class="collapsible-header"><i class="material-icons">place</i>Second</div>
<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>
</li>
<li>
<div class="collapsible-header"><i class="material-icons">whatshot</i>Third</div>
<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>
</li>
</ul>
CSS:
.collapsible li.disabled .collapsible-body {
display: none !important; /*or using id of the app to avoid the use of !important*/
}
.collapsible li.disabled .collapsible-header {
background: rgb(221,221,221);
}
Using Materialize CSS within Laravel, and depending on certain situations I wanted to be able to disabled "Collapsible" elements, like you can easily with "Tabs" by adding the class of "disabled" should you need to, e.g:
<li @if(count($devices) == 0) class="tab col s4 disabled" @else class="tab col s4" @endif><a href="#mydevices">My Devices</a></li>
Tab Elements: MaterializeCSS Tabs
Collapsible Elements: MaterializeCSS Collapsible
But this doesn't work for collapsible elements. The workaround is just to hide the whole element but disabling shows the user what they potentially could get to where they to do more etc.
So this is the bit I'm trying to make disabled:
<div @if(count($devices) == 0) class="collapsible-header disabled" @else class="collapsible-header" @endif>My Devices</div>
Thoughts / Ideas appreciated :)
Using Materialize CSS within Laravel, and depending on certain situations I wanted to be able to disabled "Collapsible" elements, like you can easily with "Tabs" by adding the class of "disabled" should you need to, e.g:
<li @if(count($devices) == 0) class="tab col s4 disabled" @else class="tab col s4" @endif><a href="#mydevices">My Devices</a></li>
Tab Elements: MaterializeCSS Tabs
Collapsible Elements: MaterializeCSS Collapsible
But this doesn't work for collapsible elements. The workaround is just to hide the whole element but disabling shows the user what they potentially could get to where they to do more etc.
So this is the bit I'm trying to make disabled:
<div @if(count($devices) == 0) class="collapsible-header disabled" @else class="collapsible-header" @endif>My Devices</div>
Thoughts / Ideas appreciated :)
Share Improve this question asked Mar 25, 2016 at 13:50 WebTimWebTim 2476 silver badges11 bronze badges1 Answer
Reset to default 6I'm not a "Laravel" guy but I can propose you the following solution for HTML/JS/CSS:
<ul class="collapsible" data-collapsible="accordion">
<li class="disabled">
<div class="collapsible-header"><i class="material-icons">filter_drama</i>First</div>
<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>
</li>
<li>
<div class="collapsible-header"><i class="material-icons">place</i>Second</div>
<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>
</li>
<li>
<div class="collapsible-header"><i class="material-icons">whatshot</i>Third</div>
<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>
</li>
</ul>
CSS:
.collapsible li.disabled .collapsible-body {
display: none !important; /*or using id of the app to avoid the use of !important*/
}
.collapsible li.disabled .collapsible-header {
background: rgb(221,221,221);
}
本文标签: javascriptMaterialize css collapsible make disabledStack Overflow
版权声明:本文标题:javascript - Materialize css collapsible make disabled - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745557628a2155969.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论