logo
down
shadow

How to Use Bootstrap with Drop Down?


How to Use Bootstrap with Drop Down?

By : Hüseyin Utku Aslan
Date : November 17 2020, 11:58 AM
Hope that helps The drop down form shows up on the page, but the categories are just awkwardly floating below it and clicking on the drop down form does nothing. If I take out the bootstrap form the drop down form then works perfectly, but it is an ugly default version. , Thank you ptd
code :
<%= f.collection_select :categories, Value::VALUES, :to_s, :to_s, { :include_blank => true }, {class: 'form-control', placeholder: 'Choose Category'} %>


Share : facebook icon twitter icon
Bootstrap drop down does not select the element. need drop down with button group design

Bootstrap drop down does not select the element. need drop down with button group design


By : dev test
Date : March 29 2020, 07:55 AM
This might help you I am using twitter bootstrap and looking for a drop down that will look like a button group. The problems are that in all the twitter bootstrap example, the drop down is only act as a menu item so the selected item is not really changed: , I convert this web finding to a jquery plugin:
code :
(function($) {
    $.fn.buttonSelect = function() {
        this.hide().wrap('<div class="btn-group"/>');
        var select = this.parent();
        var selectedOption=this.find('option[selected]').length>0?this.find('option[selected]'):this.find('option:nth(0)');
        var currentValue = selectedOption.val();
        var currentText = selectedOption.text();
        select.html(
            '<input type="hidden" value="' + this.val() + '"/>'+
            '<a class="btn dropdown-toggle" data-toggle="dropdown" href="javascript:;">'+
                '<span>'+currentText+'</span>'+
                '&nbsp;&nbsp;<span class="caret"></span>'+
            '</a>'+
            '<ul class="dropdown-menu"></ul>');

        var dropdownMenu=select.find('.dropdown-menu');
        this.find('option').each(function(o, q) {
            dropdownMenu.
                append('<li><a href="javascript:;" data-value="' + $(q).attr('value') + '">' + $(q).text() + '</a></li>');
        });

        var hidden=select.find('input[type=hidden]');
        var label=select.find('.btn span:nth(0)');
        dropdownMenu.find('a').click(function() {
            hidden.val($(this).data('value')).change();
            label.text($(this).text());
        });

        return this;
    };
})(jQuery);
change bootstrap drop down to drop horizontal right

change bootstrap drop down to drop horizontal right


By : Y.C.
Date : March 29 2020, 07:55 AM
This might help you How does this look:-
Demo Demo2 Submenu dropping down.
code :
<div class="span4">
    <div class="btn-group"> <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="#">
              <h3>Choose Child</h3>
              <img id="mainIcons" src="boyStudent.png" alt="boyStudent">
               <span class="right-caret right"></span>
         </a>

        <ul class="dropdown-menu rightMenu">
            <li>
                <div class="btn-group"> <a href="parent_homepage_2.html" style="text-align:center;" class="btn btn-link operationsButtons">
                   <h5>A</h5>
                   <img id="mainIcons" src="boyStudent.png" alt="boyStudent"></a>
 <a href="parent_homepage_2.html" style="text-align:center;" class="btn btn-link operationsButtons">
                   <h5>J</h5>
                   <img id="mainIcons" src="girlStudent.png" alt="girlStudent"></a>

                </div>
            </li>
        </ul>
    </div>
   .rightMenu {
    position:relative;
    float:right;
}
.right-caret {

    border-bottom: 4px solid transparent;
    border-top: 4px solid transparent;
    border-left: 4px solid #000000;
    display: inline-block;
    height: 0;
    opacity: 1;
    vertical-align: top;
    width: 0;

}
.right
{
    float:right;
}
bootstrap-select drop-down get hidden by another drop-down

bootstrap-select drop-down get hidden by another drop-down


By : Barood
Date : March 29 2020, 07:55 AM
will be helpful for those in need Why does some parts of the first drop-down menu get hidden by another drop-down menu below in the following example: , If you put z-index:0 on the input-group in the 2nd form it works ok.
code :
  ...
 <form class="form-horizontal" action="/compare/" method="get" role="form">
        <div class="input-group" style="z-index:0;"> 
  ...
Bootstrap Drop down JavaScript not working for multiple drop downs

Bootstrap Drop down JavaScript not working for multiple drop downs


By : Will Man
Date : March 29 2020, 07:55 AM
may help you . It seems like your click event function is going to end up effecting other dropdowns than the one you clicked, because the selector $(".btn-default-dropdown") is going to select any dropdown in the page. You need to narrow down the results of the selector by finding the dropdown related to the clicked anchor tag like so:
code :
$(".dropdown-menu li a").click(function() {    
    $(this).parent(".btn-group")...//find the element inside this group
}
Bootstrap 3: How to drop the left sidebar drop below content using push-pull

Bootstrap 3: How to drop the left sidebar drop below content using push-pull


By : Jean-francois Nadeau
Date : March 29 2020, 07:55 AM
will be helpful for those in need If you think "mobile-first", layout the columns in the desired mobile order first, then use push/pull to adjust the columns for larger screens..
code :
<div class="container">
 <div class="row">
   <div class="col-sm-9 col-sm-push-3"> Main Container</div>
   <div class="col-sm-3 col-sm-pull-9"> Sidebar</div>
 </div>
</div>
Related Posts Related Posts :
  • An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue
  • How to setup nested routing for a self referencing controller in Rails 4
  • middleman app it is possible to create a contact form?
  • How to refactor this piece of code
  • How can I know if a user has access to all or just some resources with Cancan?
  • How can I run a ruby class from rake file?
  • Send JSON data as post method from rails controller to a web service
  • How to test Controllers under different namespaces and why this test fails?
  • rspec expect condition OR condition
  • Page loads unnecessary queries Ruby On Rails
  • Why "bundle install" try to install outdated version of gems?
  • Rails - Customize model validation error messages but without a database
  • When to switch from cucumber to rspec in the BDD cycle for a login procedure
  • Multipart response for web service
  • How to hide Add new option in Rails Admin
  • Override CollectionProxy find method
  • Rails 4 simple_form has_many through check boxes not saving
  • ruby on rails authentication using devise gem
  • Rails iteration over arrays and hashes
  • Creating inline date_select dropdowns using simple_form and zurb foundation
  • NameError in SongsController#index uninitialized constant Song::FriendlyId
  • Rails how to improve if record exists?
  • omniauth custom request phase form
  • Rails 5 - Saving the absolute current url via a button to a cookie?
  • How can / should I override the `build` method for a my model?
  • Install Rails Failed on OSX 10.8.4
  • ruby on rails - undefined method valid?
  • Users Registration on POST
  • Rails application variables in carrierwave store_dir
  • How to customize simple_form for json nested hash
  • Couldn't find file 'jquery', Sprockets::FileNotFound in StaticPages#home error
  • How should I use the alias_method_chain for the build method?
  • how to create two custom registration forms in devise?
  • Rails 4 link_to Destroy not working in Getting Started tutorial
  • How does ruby on rails dynamically define `find_by_id`, `find_by_name` methods?
  • JBuilder dynamic keys for model attributes
  • `initialize': No such file or directory - getaddrinfo (Errno::ENOENT) when Rails new app
  • What is the Ruby equivalent of Node.js' socket.io?
  • Where rails store standard helpers?
  • how to check expected result matches any of give values in rspec?
  • Form submission to create multiple objects
  • Simple Twitter Login with Rails and Email confirmation
  • Where should helpful functions for my controller go in Rails?
  • Using session variable in the Model or the other way
  • Why can't I have ruby code and comments in Embedded Ruby?
  • Rails: How can I make an object available in all views?
  • Cannot enter simply form information into SQLite DB (Rails)
  • Rails - Retain form values on failed submission. Getting "First argument in form cannot contain nil or be empty&quo
  • How to handle STI and build related models automatically?
  • Suppress an error when saving a record in Rails
  • Rails AJAX reload the page. Why?
  • How to pass user attributes to action mailer
  • Custom Validator to Prevent an appointment from being scheduled too early in day?
  • Postgres Enable TCP/IP Connection
  • How do I avoid the circular argument reference warning in activesupport
  • Unable to push to heroku master because of rails/spring version error
  • deep nested routes in rails
  • Best approach to Users Profile Images in Rails App
  • RailsInstaller: Can I maintain the gem fold when re-installing a new version?
  • couldn't find file 'jquery-ui' i get this error even after having this file in my application.js
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org