首页 \ 问答 \ 单击外框时关闭灯箱(Close lightbox when click outside box)

单击外框时关闭灯箱(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
更新时间:2023-07-15 09:07

最满意答案

这是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 source code here.)

If unique is False then there can be more than one Story with the same Channel. This is a ManyToOne relationship, so you probably want this to be a ForeignKey field instead.

相关问答

更多
  • 如果你很乐意任意选择其中的一个副本,我认为以下几点可能会起作用。 也许不是最有效,但很简单,我想你只需要运行一次。 请确认这一切都适用于某些测试数据,以防万一我做了一些愚蠢的事情,因为您将要删除一堆数据。 首先我们找到形成重复的对象组。 对于每个组,(任意)选择一个我们将要保留的“主”。 我们选择的方法是选择pk最低的方法 master_pks = MyModel.objects.values('A', 'B', 'C' ).annotate(Min('pk'), count=Count('pk') ...
  • 请执行一个简单的声明: 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 ...
  • 当我这样做时,我创建了2个约定。一个是AttributePropertyConvention,另一个是IReferenceConvention。 我的属性看起来像这样: public class UniqueAttribute : Attribute { public UniqueAttribute(string uniqueKey) { UniqueKey = uniqueKey; } public string UniqueKey { get; set; ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)