Source: How do I change the value of a global variable inside of a function
1 2 3 4 5 |
var maVariableGlobale = 0; function maFonction(){ maVariableGlobale = 1; } |
Source: How do I change the value of a global variable inside of a function
1 2 3 4 5 |
var maVariableGlobale = 0; function maFonction(){ maVariableGlobale = 1; } |
Source: https://stackoverflow.com/questions/13509669/find-out-if-a-variable-is-in-an-array
1 2 |
var bpMobile = ['small', 'medium']; var bpDesktop = ['large', 'xlarge', 'xxlarge']; |
1 2 3 4 5 |
if($.inArray(Foundation.MediaQuery.current, bpMobile) != -1){ alert('Mobile!'); } else { alert('Desktop!'); } |
1 2 |
$toto: lorem; @import url('/themes/#{$toto}/style/bootstrap.min.css'); |
Nous donnera: @import url("/themes/lorem/style/bootstrap.min.css");
.
Attention:
1 2 |
$toto: lorem; @import url('/themes/' + $toto + '/style/bootstrap.min.css'); |
Nous donnera: @import url("/themes/lorem/style/bootstrap.min.css");
.
Source : Demo jsFiddle.net.
.myClass:nth-last-child(-n+4){}
nous donne en jQuery :
1 2 |
var myVariable = 4; $('.myClass:nth-last-child(-n+'+myVariable+')').doSomething(); |
1 2 3 4 |
(function(){ var getColumnsCount = $('.container').attr('data-columns'); $('.list .item:nth-last-child(-n+'+getColumnsCount+')').addClass('emphasis'); })(); |
© 2021 devfrontend.info
Theme by Anders Norén — Up ↑