twitter bootstrap 3 - Tooltip for mobile screen -


is allowed if tooltip not having href component? here code :

<a data-toggle="tooltip" title="please click on map of precise location"><i class="fi flaticon-question"></i></a>

i removed href because if click on tooltip, web goes top of page (on mobile screen). there other best practice this?

does have anchor @ all? should able along lines of.

$(document).ready(function(){    $('[data-toggle="tooltip"]').tooltip()  })
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>      <i class="glyphicon glyphicon-question-sign"       data-toggle="tooltip"       data-placement="bottom"       title="contextual mouse/touch users">  </i>  <span class="sr-only">contextual screen readers</span>

unless you're icon should go somewhere shouldn't anchor. thing i've added sr-only block allow screen readers read out contextual help.

alternatively can make sure anchor doesn't move page attaching event , preventing default behaviour.

//untested!  $(document).ready(function(){    $('[data-toggle="tooltip"]').tooltip();    //comment following line out see page move on click    $('a[data-toggle="tooltip"]').click(function(e){e.preventdefault()})  })
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>    <br/><br/><br/><br/>your icon below here show lack of scrolling<br/><br/><br/><br/><br/><br/><br/>keep going...<br/><br/><br/><br/><br/><br/><br/><br/><br/>just little more<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>  <a href="#" data-toggle="tooltip"   title="please click on map of precise location">  <i class="glyphicon glyphicon-question-sign"></i>  </a>


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -