[SailfishDevel] Scroll horizontal

Rudi Timmermans rudi.timmer at gmx.us
Thu Jun 11 11:44:39 UTC 2015


Hi Andrey,

Ok i have try it but now i can not open anymore my chat window.

If you can give me a hint what i change as the best i would love it 
thanks for that !


This i have into my code as messenger.js


     (function(){

         var  meta  =  document.createElement('meta');

         meta.setAttribute('name',  'viewport');

         if  (screen.width  <=  540)

           meta.setAttribute('content',  'width=device-width/1.5,  initial-scale='+(1.5)+',  maximum-scale='+(1.5)+',  user-scalable=no');

         else  if  (screen.width  >  540  &&  screen.width  <=  768)

           meta.setAttribute('content',  'width=device-width/2.0,  initial-scale='+(2.0)+',  maximum-scale='+(2.0)+',  user-scalable=no');

         else  if  (screen.width  >  768)

            meta.setAttribute('content',  'width=device-width/3.0,  initial-scale='+(3.0)+',  maximum-scale='+(3.0)+',  user-scalable=no');

         else

             meta.setAttribute('content',  'width=device-width,  initial-scale=1.0,  maximum-scale=1.0,  user-scalable=no');

         document.head.appendChild(meta);

         console.log("inserte  meta");

     })();

Into my messenger.qml i have this:



Page  {


     id:  page
     SilicaWebView  {


         url:  "https://www.messenger.com/login"
         anchors.fill:  parent
         overridePageStackNavigation:  true
         experimental.preferences.developerExtrasEnabled:  true
         experimental.userStyleSheet:  Qt.resolvedUrl("helper/messenger.css")
         experimental.userScripts:  [
             Qt.resolvedUrl("helper/console.js"),
             Qt.resolvedUrl("helper/messenger.js")
         ]
         experimental.preferences.navigatorQtObjectEnabled:  true
         experimental.preferences.fullScreenEnabled:  true
         experimental.preferences.offlineWebApplicationCacheEnabled:  true
         onTitleChanged:  {     




---
Best regards!

Rudi Timmermans.

Andrey Kozhevnikov schreef op 11/06/15 om 13:30:
> I mean webpage viewport size. when you using QML WebView server detect 
> it as mobile client and setting webpage width to your device screen 
> width, and you can't scroll.
>
> 11.06.2015 16:28, Rudi Timmermans пишет:
>> Hi Andrey,
>>
>> Can you tell me where i can change this as best into the code please ?
>>
>> I'm nit shure i understand this corectly sorry...
>> ---
>> Best regards!
>>
>> Rudi Timmermans.
>> Andrey Kozhevnikov schreef op 11/06/15 om 13:22:
>>> It should scroll if viewport width is higher than webview width.
>>>
>>> 11.06.2015 16:20, Rudi Timmermans пишет:
>>>> Hi,
>>>>
>>>> As i'm start with coding for Sailfish OS, i have some idea but i 
>>>> can not figer it out how i can fix this into the code.
>>>>
>>>> I have made a Facebook Messenger with the www.messenger.com webpage 
>>>> build into the app, now i like to have that users can scroll 
>>>> horizontal to see older message into the chat window, the same as 
>>>> on the webpage when you have open it into the browser...
>>>>
>>>> I have search and search for examples how to code this but i can 
>>>> not found anything and i can found it out how i need to code it.
>>>>
>>>> You can find all the messenger sources here:
>>>>
>>>> messenger.css
>>>>
>>>> https://drive.google.com/open?id=0B8QiRsNYbAIqMFhqOHExVDBFdGM&authuser=0
>>>>
>>>> messenger.js
>>>>
>>>> https://drive.google.com/open?id=0B8QiRsNYbAIqbk9GbEZNWmpaWWc&authuser=0
>>>>
>>>> messengerpage.qml
>>>>
>>>> https://drive.google.com/open?id=0B8QiRsNYbAIqTGF1NDYzSGRQRlE&authuser=0
>>>>
>>>> Thanks guys for the helps !!!
>>>> -- 
>>>> ---
>>>> Best regards!
>>>>
>>>> Rudi Timmermans.
>>>>
>>>>
>>>> _______________________________________________
>>>> SailfishOS.org Devel mailing list
>>>> To unsubscribe, please send a mail todevel-unsubscribe at lists.sailfishos.org
>>>
>>>
>>>
>>> _______________________________________________
>>> SailfishOS.org Devel mailing list
>>> To unsubscribe, please send a mail todevel-unsubscribe at lists.sailfishos.org
>>
>>
>>
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>> To unsubscribe, please send a mail todevel-unsubscribe at lists.sailfishos.org
>
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20150611/ff3e4d9a/attachment-0001.html>


More information about the Devel mailing list