user2771150
user2771150

Reputation: 732

removing "class" and "data-toggle" from bootstrap dropdown

I want to disable clicking on a bootstrap dropdown because I've hover implemented. I have done this by removing class and data-toggle from the <a> tag.

Original declaration:

<a href="#" class="dropdown-toggle" data-toggle="dropdown">Programs <b class="caret"></b></a>

disable clicking:

<a href="#" Programs <b class="caret"></b></a>

But for smaller screens, i.e. mobile, I want to enable clicking on a dropdown since hover would not be possible. How would I do this?

Upvotes: 0

Views: 822

Answers (2)

AVAVT
AVAVT

Reputation: 7143

Why not both?

<a href="#" class="hidden-xs dropdown-toggle" data-toggle="dropdown">Programs <b class="caret"></b></a>
<a href="#" class="visible-xs"> Programs <b class="caret"></b></a>

This way only 1 of the 2 dropdown will be visible to end user at any given view port. Note the first one uses hidden-xs class while the other uses visible-xs.

Upvotes: 1

Sando K
Sando K

Reputation: 139

Try this:

Use .visible-xs and .visible-sm to make things visible only on small screens (mobile & tablet).

You can use .hidden-md and .hidden-lg to hide things on desktop.

Upvotes: 1

Related Questions