Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    click not firing the event on mobile devices

    Hello,

    I have this situation with part of the code that works fine on desktop version but not in mobile. Here's the code, I really don't know where's the error.

    I appreciate any suggestion.

    Code:
    Wheel.prototype.buttonClick = function(){
    	//Getting button
    	var clickedButton = this.buttonCurrent();
    	clickedButton = this.elem.find("#"+this.wrapperId+"_button_"+clickedButton);
    
    	//Firing either 'href' attribute if setted, or the click delegate attached if not
    	var buttonHref = clickedButton.attr('href');
    	if (buttonHref != undefined && buttonHref != '#'){
    		if (clickedButton.attr('target') == '_blank'){
    			window.open(buttonHref);			
    		}
    		else{
    			window.location.href = buttonHref;
    		}
    	}
    	else{
    		clickedButton.click();
    	}
    };
    Thanks
    Last edited by judelgado; 09-08-2014 at 11:45 PM.

  2. #2
    New to the CF scene
    Join Date
    Oct 2015
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Looks like event delegation is the way to do this since, when you modify the target element, bind seems to fail. I'm currently creating an app using the Cordova library.The problem lies with android 4.3 and lower,click event does not seem to be firing in mobile browsers.I am firing a click event on a div by click() function of jquery. It is working good in desktop browser, but in mobile devices it is not working.Unlike click and touchstart , touchend events are fired instantly.In touch environments, the plugin retains the order of event firing that is seen"vclick" event handler simulates the "onclick" event handler on mobile devices.If jQuery Mobile is not loaded, calling the .vclick() method may not fail directly.Opera Mini supports click events, but it's not always clear when it fires them.So I am building a small proof of concept before I build a big sprawling level or what have you for a game I am working on.You're not on a mobile! This demo is specifically for viewing on mobile devices, I don't know how useful it's going to be for you.


    .................................
    wordpress bootstrap themes


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •