我有兩個獨立的web元素,如果我滾動一個元素的內容,我也希望第二個元素同時滾動。這裏有一個例子:https://stackedit.io手動觸發DOM元素的滾動事件?
我做了下面的代碼,但它不工作:
element.find('.fullscreen-mk-content-textarea').on('scroll', function(e){
// first element will trigger this event, then manully trigger the
// the scroll of the 2nd element. It's my plan.
console.log(e); // works
element.find('.right-side').trigger('scroll'); // doesn't work...
});
我該怎麼辦?
讓我先試試吧〜謝謝! – 2014-10-08 08:25:47
完美!非常感謝〜 – 2014-10-08 08:36:13