javascript - Django served bootstrap.js file not working in mobile -
edit: i've narrowed problem down - works when link externally hosted bootstrap.min.js file, , doesn't work when use local file (django's dev static folder setup)
this has me pulling hair out. i've looked @ tons of threads, inspected html carefully, , can't tell what's difference. here's dev page: http://iceberg.creatifcubed.com:8080, , here's jsfiddle http://jsfiddle.net/5uaup/4/
the problem on mobile browser (iphone , ipad) login dropdown closes when click on it. many threads recommended e.stoppropagation()
- showing in desktop browser not on mobile browser. added alerts, , tried different variations attach event - , it's not being called in mobile safari.
i add same code jsfiddle - , works there (copied , pasted same html - see jsfiddle /5uaup/5). don't need e.stoppropagation()
. ran code through w3 validator , there no errors. idea causing this?
currently, page set use local static file. it's been included , - can see @ http://iceberg.creatifcubed.com:8080/static/lib/bootstrap-2.3.0/js/bootstrap.min.js . i've checked headers, , don't see strange - why cause javascript bug when link local file? other parts of file - carousel plugin - seem working.
the solution easier you'd think , it's unfortunate people have waste time on little quirk, promise know it, you'll never forget it!
$('.dropdown form').on('click tap', function (e) {
all have add "tap" handler, mobile browsers react properly. way, work because jquery automatically split event handlers spaces, "click" , "tap" 2 distinct handlers
Comments
Post a Comment