0

I would like to use two types of sliders.

First one : a simple gallery slider when viewing a page on a mobile device.

And a second one : a more complex slider when viewing the page on a computer.

What's the best way of doing this ?

2 Answers 2

2

You can use Media Query for this, Create 2 sliders differently

<div id="ComplexSlider" style="display: none;">
   // All your code
</div>

<div id="Mobilelider" style="display: none;">
   // All your code
</div>

@media (max-width: 320px){
#ComplexSlider{
display: none;
}

#MobileSlider{
display: block;
}
}

@media (min-width: 321px){
#ComplexSlider{
display: block;
}

#MobileSlider{
display: none;
}
}
Sign up to request clarification or add additional context in comments.

Comments

1

Look at the doc : http://getbootstrap.com/css/#responsive-utilities-classes

You just have to specify which device you want to make visible or not in the class attribute.

.hidden-xs won't print on extra small device

.hidden-sm won't print on small device

.hidden-md won't print on medium device

.hidden-lg won't print on large device

<div id="ComplexSlider" class="hidden-xs ">
   ...
</div>

<div id="Mobilelider" class="hidden-sm hidden-md hidden-lg">
   ...
</div>

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.