M
M
mbhusty2020-11-09 13:19:23
JavaScript
mbhusty, 2020-11-09 13:19:23

How to make a block like this on flexbox?

Hi all! there is such a block in the design, how to properly lay it out so that there are no problems on the adaptive?

img
5fa9178093a1c614704578.png

Answer the question

In order to leave comments, you need to log in

5 answer(s)
D
Dmitry Belyaev, 2016-07-12
@dev400

<div>
  <label><input type="checkbox" data-param="param1" class="link-changer">param 1</label>
  <label><input type="checkbox" data-param="param2" class="link-changer">param 2</label>
  <label><input type="checkbox" data-param="param3" class="link-changer">param 3</label>
  <label><input type="checkbox" data-param="param4" class="link-changer">param 4</label>
</div>
<div>
  <a href="/test" class="change-on-check">test 1</a><br>
  <a href="/test" class="change-on-check">test 2</a><br>
  <a href="/test" class="change-on-check">test 3</a><br>
</div>

var links = document.getElementsByClassName('change-on-check');
Array.prototype.forEach.call(links, function(link) {
  link.href += '?';
});
Array.prototype.forEach.call(
  document.getElementsByClassName('link-changer'),
  function(checkbox) {
    checkbox.addEventListiner('change', onChange, false);
  }
);

function onChange(event) { 
  var param = '&' + encodeURIComponent(event.target.getAttribute('data-param'));
  var add = event.target.checked;
  Array.prototype.forEach.call(links, function(link) {
    if(add) {
      link.href += param;
    } else {
      link.href = link.href.replace(param, '');
    }
  });
}

A
ArturArturov, 2016-07-12
@ArturArturov

javascript.ru/window-location

S
Sergey delphinpro, 2020-11-09
@delphinpro

I would do something like this

A
Akbar Ilkhambaev, 2020-11-09
@AJAXes

5fa918df5e54c110037394.pnghttps://habrastorage.org/webt/5f/a9/17/5fa9178093a... >
header {
display : flex;
} // large block on the image
div {
display : flex;
flex-direction : column ;
align-items : center ;
} // Small blocks

M
Maxim Shchirba, 2020-11-09
@caest

Something like this, change classes, values ​​and finish
https://codepen.io/caest/pen/xxVmyav

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question