使用JQuery,是否可以将一个类的所有成员添加到另一个类?在此,我试图将类ui-widget-content
的所有成员添加到类draggable
。将一个类的所有成员添加到另一个类
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Draggable - Auto-scroll</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<style>
#draggable, #draggable2, #draggable3 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
</style>
<script>
$(function() {
$(".draggable").draggable({ scroll: true });
});
</script>
</head>
<body>
<div id="draggable" class="ui-widget-content">
<p>Scroll set to true, default settings</p>
</div>
<div style="height: 5000px; width: 1px;"></div>
</body>
</html>
我不明白你的问题..类名没有会员... –
@KevinB通过“成员”,我的意思是“有内容一个特定的类属性“ - 将具有特定类的HTML元素称为”类的成员“是不正确的? –
也许吧,但它很混乱,因为一个类可以引用与你指的完全不同的东西。 –