I am trying to add a “change log” to the jQuery mobile app. In the event of an error, the user should be able to see what went wrong. So I implemented a popup with a text box (see code below)
<div data-role="popup" id="popupLog" data-overlay-theme="a" data-theme="b" style="max-width:400px;" class="ui-corner-all"> <div data-role="header" data-theme="b" class="ui-corner-top"> <h1>Logg-Einträge:</h1> </div> <div data-role="none" data-theme="b" class="ui-corner-bottom ui-content"> <textarea style="height: 120px; max-height: 120px" readonly="readonly" data-mini="true" cols="40" rows="8" id="popupTextArea"></textarea> <a href="#" data-role="button" data-inline="true" id="btn_textArea" data-rel="back" data-theme="c">OK</a> </div> </div>
This popUp is populated with data and opens when a specific button is clicked:
$('#showLog').click(function() { $("#popupDialog").popup("close"); // populate the textArea with the text $("#popupTextArea").text(sessionStorage.getItem("logStack")); // open popUp after a specific time setTimeout( function(){$('#popupLog').popup('open'); }, 1000 ); });
All functions work up to this point. The problem is this: when the user scrolls in the text box, closes popUp and opens it again, the position of the scroller remains the same - for example, the user scrolls down, closes popup and opens it again - popUp will be at the bottom of textarea agein. But I would like to get everything at the top of the text box when popUp opens again. To implement this, I implemented an “Ok” -Button in this popUp as follows, which closes popUp and sets Top scroll to 0:
$('#btn_textArea').click(function() {
I'm afraid at this moment, because the look of textArea is still the same. Do I need to upgrade or something else? I would be very grateful for any help ....
source share