[MOBILE] How to autoscrolling for android and iOS (Phonegap/Cordova)

Eccomi qui, come primo articolo vi condivido un’autoscrolling per chat (alla whatsapp o facebook messanger) che vi permetterà di rendere la vostra chat molto più comoda da vsualizzare.

Dopo tanti tentativi e aiuti a destra e a manca, sono riuscito ad avere un codice HTML5/CSS/jQuery compatibile per quasi tutti i device da android 2.3.x -> 4.x.x ad iOS 5 e 6

<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript" src="cordova-2.3.0.js"></script>
    <script type="text/javascript" src="jquery-1.8.3.js"></script>
  <style>
    div.demo {
        background:#CCCCCC none repeat scroll 0 0;
        border:3px solid #666666;
        margin:5px;
        padding:5px;
        position:relative;
        width:200px;
        height:100px;
        overflow:auto;
    }
  p { margin:10px;padding:5px;border:2px solid #666;width:1000px;height:1000px; }
  </style>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
  <div class="demo"><h1>lalala</h1><p>Hello</p></div>
<script>
    //window.setTimeout(function(){alert("testing");$("div.demo").scrollTop(600)},2000);
    $("div.demo").css("overflow","hidden");
    $("div.demo").scrollTop(600);
    $("div.demo").css("overflow","auto");
</script>
 
 
 
 
 
 
 
</body>
</html>

Un pensiero su “[MOBILE] How to autoscrolling for android and iOS (Phonegap/Cordova)

  1. Free Netflix

    Just desire to say your article is as astonishing. The
    clarity in your post is simply cool and i can assume you’re an expert on this subject. Well with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please carry on the gratifying work.

    Replica

Lascia un Commento

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *

È possibile utilizzare questi tag ed attributi XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>