V
V
Vlad Romanovsky2013-12-25 18:36:16
css
Vlad Romanovsky, 2013-12-25 18:36:16

Duplicate elements for the sake of adaptability

Hello!
There was such a problem: the site has a functional element that should adapt to screen resolutions, but because of its size it cannot correctly adjust, and bootstrap 3 with its new grid system does not allow you to adjust the interface for small screens.
I'll show you with an example.
6rZPhp.png
The heading with buttons near the table needs to be adjusted for smartphones, but proportional reduction will not save - the buttons fit on the heading.
Therefore, I hide these buttons and display them instead
6rZR0B.png
. As a result, 2 elements coexist on the page that perform the same function, but for different screens and are hidden through hidden-lg or visible-lg.
How bad is this solution? I don’t want to especially screw up crutches and change the bootstrap itself.
And the example is actually not the only one. There were several similar situations when it was necessary to duplicate the functionality

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
alexesDev, 2013-12-25
@alexesDev

In bootstrap, the top menu is hidden the same way as in yours, only there are stripes instead of the word menu. Why didn't this solution work?

A
Andrey, 2013-12-25
@svistiboshka

everything that is duplicated in the markup can be duplicated js why not.

$( "#main_nav ul" ).clone().appendTo( "#mobile_nav" );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question