Here is a hacky solution using jQuery:
HTML:
<label for="myField">My Field:</label> <input type="text" id="myField" /> <div class="ad_wrapper">my fixed position container</div>
CSS:
.ad_wrapper { position: fixed; bottom: 0; left: 0; width: 100%; height: 40px; background-color: rgba(0,0,0,0.75); color: white; text-align: center; } .unfixed { position: relative; left: auto; bottom: auto; }
JS:
$(function () { adWrapper = $('.ad_wrapper'); $(document).on('focusin', 'input, textarea', function() { adWrapper.addClass('unfixed'); }) .on('focusout', 'input, textarea', function () { adWrapper.removeClass('unfixed'); }); });
Silkster Feb 27 '14 at 22:14 2014-02-27 22:14
source share