SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2012
    Location
    Web
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dynamic Dropdown not working because of a dropdown script

    Hello all. Initially I had a problem. I designed my site using Twitter Bootstrap and I used a responsive navbar. The extreme right dropdown gives two options, faculty and student login (http://ankursinha.net/TestSite/index.php), which kept disappearing on touching the link when viewed on mobile phones and tablets. So I was asked to add this code to the bootstrap-dropdown.js file.

    Code:
    $(function () {
      $('html').on('click.dropdown.data-api', clearMenus)
      $('body').on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
               .on('click.dropdown.data-api touchstart.dropdown.data-api'  , toggle, Dropdown.prototype.toggle)
               .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
     })
    Adding that solved my problem and everything worked fine on the phones and tablets.

    Now my problem is, I have a dynamic dropdown file upload system for my site. It works perfectly on localhost but not on webserver. I realized, the dropdowns in the second and third level do not appear because of the dropdown script I added to overcome the mobile navigational dropdown issue. Removing that solves the current problem but gives rise to the previous problem. And solving the previous problem gives rise to the current problem.

    How do I solve both of them and make things work. This is the problem: http://ankursinha.net/TestSite/upload.php and this is how it must be: http://ankursinha.net/upload.php (choose the computer science engineering option)

    Please help me overcome this issue.

    Thank you

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2012
    Location
    Web
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello all, apparently the problem lies with the latest version of Bootstrap. I checked all the issues on GitHub and I turned out to be right. I switched back to Bootstrap 2.0.4 and everything worked fine. Anyone having the same problem, this solution might be of some help to you.

    Thank you

  3. #3
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,438
    Mentioned
    82 Post(s)
    Tagged
    3 Thread(s)
    Thanks for the update - it is good to know how a problem was sorted.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •