跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[前端开发] js 监听问题求助

发表于

现在有两个块,结构如下:

<div id = "outer" style = "width:50px;height:50px;">
	<span id = "inner" style = "positon:absolute;buttom:0;right:0;width:5px;height:5px;">
	
	</span>
</div>

如图: https://mjj.today/i/TXCM5H 这两个块都监听了mousedown,mousemove,mouseup

我想实现的功能

点击 outer 可以移动整个块,点击 inner 拖动可以控制 outer 块的宽高。

现状

如果我拖拽 inner 的话,outer 会在增加宽高的同时移动。

尝试过

增加一个状态控制 outer 不进行处理,但是无法实现两个功能同时存在。

这种情况有什么好的处理办法吗?用的原生的 js 。

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.