JWPlayer的灯箱效果(Lightbox effect for JWPlayer)
任何人都可以告诉如何为JWPlayer设置灯箱式效果吗? 例如,单击VideoHive主页上的任何缩略图: http : //videohive.net/ 。 然后单击视频预览,JWPlayer将像灯箱图像一样打开。 在某些情况下,播放器也会调整大小,但不是全屏。 这一切是如何完成的?
Can anyone tell how to set up a lightbox-style effect for JWPlayer? For example, click any of the thumbnails on the VideoHive home page: http://videohive.net/. Then click video preview and the JWPlayer opens like a lightbox image. In some cases the player will be resized as well, but not full-screen. How is all of that done?
原文:https://stackoverflow.com/questions/11256396
最满意答案
将
{% url 'main_page' %}
替换为{% url main_page %}
。引自django 1.5 changelog :
值得注意的一个不赞成的功能是转向“新式”网址标签。 在Django 1.3之前,{%url myview%}之类的语法被错误地解释(Django认为“myview”是视图的文字名称,而不是名为myview的模板变量)。 Django 1.3及更高版本引入了{%load url from future%}语法,以引入纠正后的行为,其中myview被视为变量。
这样做的结果是,如果您未在模板中使用{%load url from future%},则需要将{%url myview%}等标记更改为{%url“myview”%}。 如果你使用来自未来%的{%load url},你可以在Django 1.5下删除该行
Replace
{% url 'main_page' %}
with{% url main_page %}
.Quote from django 1.5 changelog:
One deprecated feature worth noting is the shift to “new-style” url tag. Prior to Django 1.3, syntax like {% url myview %} was interpreted incorrectly (Django considered "myview" to be a literal name of a view, not a template variable named myview). Django 1.3 and above introduced the {% load url from future %} syntax to bring in the corrected behavior where myview was seen as a variable.
The upshot of this is that if you are not using {% load url from future %} in your templates, you’ll need to change tags like {% url myview %} to {% url "myview" %}. If you were using {% load url from future %} you can simply remove that line under Django 1.5
相关问答
更多-
最后我安装了django1.5以使用mysql和1.3来使用mongodb。 我用virtualenv得到它 这里有点教程(In spainsh) http://plone-spanish-docs.readthedocs.org/en/latest/python/creacion_entornos_virtuales.html Finally I installed both django1.5 to use mysql and 1.3 to use mongodb. I got it using vir ...
-
答案在我的urls.py中 请注意我的views.py中如何发送正确的登录信息以return render_to_response('uc/portal/index.html', {'state':state, 'username':username}, context_instance=RequestContext(request)) 事实证明,在我的urls.py中我定义了 url(r'^portal/$', 'portal.views.portal'), 但我没有定义 uc/portal/ind ...
-
产生此异常是因为在有效编辑后尝试重定向时, self.object = None 。 由于self.object的值是form.save()调用的结果,因此此错误的最可能原因是您已覆盖NonProfitCreateForm的save()方法,但忘记返回保存的对象。 Form.save()方法预计会返回已保存的对象,而不应该是None 。 您的NonProfitCreateForm可以修改,如下所示: class NonProfitCreateForm(forms.ModelForm): ... ...
-
我能够通过在login_view代码中添加timezone.activate(pytz.timezone(userdetails.timezone))来解决这个问题。 def login_view(request): if request.method == 'POST': user = authenticate(username=request.POST['username'], password=request.POST['password']) if ...
-
django模块导入错误 - python 2.7 vs python 3.4(django module import error - python 2.7 vs python 3.4)[2022-08-21]
Python 3改变了导入策略。 看看这个问题 。 而不是将Helpers目录添加到sys.path ,添加它的父级: sys.path.insert(0, os.path.join(BASE_DIR, 'myproject')) 或者像@albar提到的那样 - 使用相对导入: from .Helpers import views Python 3 has changed the import policy. Take a look at this question. Instead of addin ... -
在你的MEDIA_ROOT定义中,更改你的替换为一个原始字符串,否则你将会替换一个字面的单个反斜杠而不是你的意思。 MEDIA_ROOT = os.path.join(os.path.dirname(file), "media").replace(r"\\", "//") In your MEDIA_ROOT definition, change your replace to have a raw string, as otherwise you'll be replacing a literal si ...
-
我找到了解决方案 - [error]消息是一个红色的鲱鱼。 在Django 1.5中,当设置中的DEBUG = False时,设置文件中需要 ALLOWED_HOSTS 。 https://docs.djangoproject.com/en/1.5/releases/1.5/#allowed-hosts-required-in-production 否则该网站将引发500个错误 - 这就是我得到的。 添加ALLOWED_HOSTS ,一切恢复正常。 简单的RTFM案例。 I found the soluti ...
-
将{% url 'main_page' %}替换为{% url main_page %} 。 引自django 1.5 changelog : 值得注意的一个不赞成的功能是转向“新式”网址标签。 在Django 1.3之前,{%url myview%}之类的语法被错误地解释(Django认为“myview”是视图的文字名称,而不是名为myview的模板变量)。 Django 1.3及更高版本引入了{%load url from future%}语法,以引入纠正后的行为,其中myview被视为变量。 这样做的 ...
-
你是如何配置它的? 要使管理员应用程序加载静态文件,您需要在应用程序的static目录中创建符号链接。 你做过这个吗? ls -l应该给出类似的东西: admin -> /usr/local/lib/python2.6/dist-packages/django/contrib/admin/media How did you configure it? For admin app to load static files, you need to create a symbolic link inside ...
-
持久化上传文件时,Django 1.5引发UnicodeDecodeError(Django 1.5 raises UnicodeDecodeError when persisting uploaded file)[2023-12-09]
你偶然发现了Django 1.5中的一个错误: #19954存储二进制字段会导致异常 。 提交的修复方法是使用'replace'强制解码上次执行的查询: return force_text(cursor._last_executed, errors='replace') 您可以编辑Django源代码,也可以应用monkeypatch: from django.utils.encoding import force_text from django.db.backends.mysql.base import ...