Discussion Board

Results 1 to 3 of 3

Hybrid View

  1. #1
    Registered User ariefbayu's Avatar
    Join Date
    May 2011
    Posts
    24
    Hi guys,

    I've problem with addSwipeLeftListener and addSwipeRightListener. It only work on emulator and failed on Nokia Browser.

    Here's how I implement it:

    On xhr.onreadystatechange, I add the following code:


    Code:
    		if( index != (len-1))
    		{
    			swipe += "mwl.addSwipeLeftListener('#detail_" + i + "', 'mwl.addClass(\"#detail_" + i + "\", \"hide\");";
    			swipe += "mwl.removeClass(\"#detail_" + (i + 1) + "\", \"hide\")');";
    		}
    
    		if( index != 0)
    		{
    			swipe += "mwl.addSwipeRightListener('#detail_" + i + "', 'mwl.addClass(\"#detail_" + i + "\", \"hide\");";
    			swipe += "mwl.removeClass(\"#detail_" + (i - 1) + "\", \"hide\")');";
    		}

    and this code, to attach script to body:

    Code:
    	var scriptNode = document.createElement('SCRIPT');
    	var scriptText = document.createTextNode(swipe);
    	scriptNode.appendChild(scriptText);
    	
    	var bodyNode = document.getElementsByTagName('body')[0];
    	bodyNode.appendChild(scriptNode);
    This code works fine on emulator but failed on Nokia Browser. Any help is greatly appreciated.

  2. #2
    Nokia Developer Moderator isalento's Avatar
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    832
    Hi,

    The problem might be in quotation marks. Please try with the code below.
    Code:
            if (index != (len-1)) {
                swipe += "mwl.addSwipeLeftListener(\"#detail_" + i + "\", \"mwl.addClass('#detail_" + i + "', 'hide');";
                swipe += "mwl.removeClass('#detail_" + (i + 1) + "', 'hide')\");";
            }
    		if ( index != 0) {
                swipe += "mwl.addSwipeRightListener(\"#detail_" + i + "\", \"mwl.addClass('#detail_" + i + "', 'hide');";
                swipe += "mwl.removeClass('#detail_" + (i - 1) + "', 'hide')\");";
    -Ilkka

  3. #3
    Registered User ariefbayu's Avatar
    Join Date
    May 2011
    Posts
    24
    It work! Thank you!

Similar Threads

  1. Replies: 1
    Last Post: 2011-04-29, 07:50
  2. WRT widgets do not work on S60 5th emulator and Symbian^3 emulator on Vista
    By sh2sg in forum Tools and SDK Feedback (Closed)
    Replies: 2
    Last Post: 2010-12-08, 11:23
  3. Replies: 4
    Last Post: 2010-12-06, 11:32
  4. Replies: 2
    Last Post: 2008-02-22, 11:49
  5. Emulator doesn't work
    By lazmous in forum Mobile Java General
    Replies: 0
    Last Post: 2003-03-25, 15:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved