be-fe / be-fe/iSlider

zoompic插件中通过对图片双击或双指放大,在控制台报错

Open
#437 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.6k
Forks
441
PR merge metrics
No merged PRs in 30d

Description

iSlider.plugin.zoompic.js?9af6:285 Uncaught TypeError: Cannot read property 'pageX' of undefined
at handleDoubleTap (iSlider.plugin.zoompic.js?9af6:285)
at iSlider.endHandler (iSlider.plugin.zoompic.js?9af6:314)
at iSliderPrototype.handleEvent (iSlider.js?c3de:1183)

这一段代码
/**
* Double tao handle
* @param {object} evt
*/
function handleDoubleTap(evt) {
var zoomFactor = zoomFactor || 2;
var node = zoomNode;
var pos = getPosition(node);
currentScale = currentScale == 1 ? zoomFactor : 1;
node.style.webkitTransform = generateTranslate(0, 0, 0, currentScale);
if (currentScale != 1) node.style.webkitTransformOrigin = generateTransformOrigin(evt.touches[0].pageX - pos.left, evt.touches[0].pageY - pos.top);
}

pageX报错

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in iSlider.plugin.zoompic.js at handleDoubleTap around line 285, then trace the call from iSlider.endHandler and handleEvent. Reproduce the double-tap and pinch-to-zoom actions and inspect the event data reaching the handler. Done means both interactions no longer report the pageX TypeError in the console.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.