언어 설정

Menu
Sites
Language
Swipe on Gear 2

I want to detect swipes on Gear 2. I've tried several things:

My own code based on onMouseMove event, works in browser, but on device it only fires on a fresh press and not a move.

This code, again works on browser:

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
     <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
     <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>

    $('#canvas').bind('swipeleft',function(){
        Game.title.textContent = "swipeleft";
    });

    $('#canvas').bind('swiperight',function(){
        Game.title.textContent = "swiperight";
    });

This complains: js/main.js (70) :ReferenceError: Can't find variable: $

What do I need to do to enable JQuery or can that be translated to reqular javascript?

Also, why does onMouseMove not work?

 

Responses

4 댓글

JQuery source is online!!! really !!

Your Gear /Emulator dose not connect to the internet

Just copy javascript files and css to your app folders

 

Alan Evans

Thanks Nour, that was pretty dumb, thought it might package them during the build.

However, I see a "tizen-web-ui-fw/latest/js/jquery.min.js" in my project, so I added that to the index.html:

    <script src="tizen-web-ui-fw/latest/js/jquery.min.js"></script>

    <script src="js/main.js"></script>

But still get the error:

js/main.js (33) :ReferenceError: Can't find variable: $

Should that have worked?

Create new project

File->New->Tizen Wearable Web Project -> Basic - > jQuery Template

You will see jquery-1.9.1.js under js folder and index.html has

<script type="text/javascript" src="js/jquery-1.9.1.js"></script>

 

OK ?

 

AVSukhov

Hello,

You can create web app based on jQueryMobile template