Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

touchstart没有模拟成功 #1

Open
swainet opened this issue Apr 17, 2013 · 1 comment
Open

touchstart没有模拟成功 #1

swainet opened this issue Apr 17, 2013 · 1 comment
Labels

Comments

@swainet
Copy link

swainet commented Apr 17, 2013

先创建个

before(function () {
      testDiv = $('<div>');
      $('body').append(testDiv);

      testDiv.on('touchstart',function () {
        console.log('touchstart')
      })
});

来个简单的

it('tap', function () {
    eventSimulate.simulate(testDiv.get(0), 'touchstart');
});

结果:没有触发console.log

@swainet swainet closed this as completed Apr 17, 2013
@leoner
Copy link
Contributor

leoner commented Apr 17, 2013

测试时,需要浏览器支持此事件才能模拟。

@leoner leoner reopened this Apr 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants