单击外框时关闭灯箱(Close lightbox when click outside box)
我有像上面的js脚本,
#quick-view-close
作为关闭按钮,#quick-view-modal
作为框,但是当我点击外框时,框应该关闭。$('body').append('<div id="quick-view-modal"><div id="quick-view-content"> <div id="quick-view-close"></div><div class="quick-view-content"> <div class="quick-view-container col-lg-12 col-md-12 col-sm-12"> </div> </div> </div> </div>'); $('#quick-view-modal').hide(); $('#quick-view-close').click(function(){ $('#quick-view-modal').fadeOut(300); });
I have js script like above,
#quick-view-close
as close button and#quick-view-modal
as box, but when I click outside box, the box should close.$('body').append('<div id="quick-view-modal"><div id="quick-view-content"> <div id="quick-view-close"></div><div class="quick-view-content"> <div class="quick-view-container col-lg-12 col-md-12 col-sm-12"> </div> </div> </div> </div>'); $('#quick-view-modal').hide(); $('#quick-view-close').click(function(){ $('#quick-view-modal').fadeOut(300); });
原文:https://stackoverflow.com/questions/29295530
最满意答案
这是Django,而不是南方。
OneToOneField
的定义内置了unique
。 (你可以在这里的源代码中看到它。)如果
unique
为False,那么可以有多个具有相同Channel
Story
。 这是一个ManyToOne关系,所以你可能希望这是一个ForeignKey
字段。This is Django, not South. Being
unique
is built into the definition ofOneToOneField
. (You can see it in the source code here.)If
unique
is False then there can be more than oneStory
with the sameChannel
. This is a ManyToOne relationship, so you probably want this to be aForeignKey
field instead.
相关问答
更多-
如果你很乐意任意选择其中的一个副本,我认为以下几点可能会起作用。 也许不是最有效,但很简单,我想你只需要运行一次。 请确认这一切都适用于某些测试数据,以防万一我做了一些愚蠢的事情,因为您将要删除一堆数据。 首先我们找到形成重复的对象组。 对于每个组,(任意)选择一个我们将要保留的“主”。 我们选择的方法是选择pk最低的方法 master_pks = MyModel.objects.values('A', 'B', 'C' ).annotate(Min('pk'), count=Count('pk') ...
-
具有唯一索引和主键的列会产生唯一约束违例(Column with Unique Index and Primary Key gives Unique Constraint Violation)[2022-08-17]
请执行一个简单的声明: select * from admin.message_list where id = 1; 如果它不返回行,则应检查约束PK_ID是否引用ID列,如果是,请要求Oracle支持人员修复错误。 Please execute a simple statement: select * from admin.message_list where id = 1; If it wouldn't return rows, you should check if constraint PK_I ... -
add_index :people, [:firstname, :lastname, :dob], :unique => true add_index :people, [:firstname, :lastname, :dob], :unique => true
-
您可以使用表达式索引执行此操作: create unique index unq_test_a_b on (test(least(a, b), greatest(a, b)); 我不认为unique约束允许表达式(并且现在没有方便的Postgres进行测试),但这基本上是相同的。 You can do this using an index on expressions: create unique index unq_test_a_b on (test(least(a, b), greatest(a, ...
-
这是Django,而不是南方。 OneToOneField的定义内置了unique 。 (你可以在这里的源代码中看到它。) 如果unique为False,那么可以有多个具有相同Channel Story 。 这是一个ManyToOne关系,所以你可能希望这是一个ForeignKey字段。 This is Django, not South. Being unique is built into the definition of OneToOneField. (You can see it in the s ...
-
问题是'order'是SQL中的保留字。 如果你想放弃它,请使用 ALTER TABLE menus_types DROP INDEX `order` 我建议你重命名列的名称,因为它会带来很多麻烦,具体取决于你的底层框架。 The problem is that 'order' is a reserved word in SQL. If you want to drop it, use ALTER TABLE menus_types DROP INDEX `order` I would recommen ...
-
UNIQUE CONSTRAINT将像UNIQUE INDEX一样工作。 有两种方法: 使用clustered index ,行以与索引相同的顺序物理存储在磁盘上。 (因此,只有一个聚集索引是可能的) 对于non clustered index还有第二个列表,其中包含指向物理行的指针。 尽管每个新索引都会增加写入新记录的时间,但您可以拥有许多非聚簇索引。 如果您有聚集索引和非聚集索引,则非聚集索引将指向聚簇索引列。 这个'所以'答案将帮助您理解它有点清楚。 默认情况下,如果不指定任何不同(如果没有冲突的聚集 ...
-
是的,Oracle支持计算列: SQL> alter table test add calc_column as (trunc(timestamp/10000)); Table altered. SQL> alter table test add constraint test_uniq unique (type, clientid, calc_column); Table altered. 应该做你想做的事。 Yes, Oracle supports calculated co ...
-
合理的解决方法可能包括 如果更新/插入操作对速度不重要,则使用触发器检查约束 使用某种特殊值来表示null; 这可以相对正确地建模 - 具有永远不会被删除的id为0的根节点,具有parent_id DEFAULT 0和ON DELETE SET DEFAULT Reasonable workaround might include checking constraints with triggers if the update/insert operations are not critical for s ...
-
多列唯一约束FluentNHibernate通过约定自动化(Multi-column unique constraint FluentNHibernate automap via convention)[2022-08-31]
当我这样做时,我创建了2个约定。一个是AttributePropertyConvention,另一个是IReferenceConvention。 我的属性看起来像这样: public class UniqueAttribute : Attribute { public UniqueAttribute(string uniqueKey) { UniqueKey = uniqueKey; } public string UniqueKey { get; set; ...