直接在页面加载上显示模态而不使用带有materialize css的按钮

时间:2016-07-02 05:56:57

标签: materialize

我想在不使用页面加载按钮的情况下加载materialize模式。怎么做?请帮忙。

2 个答案:

答案 0 :(得分:2)

这将在页面加载时打开一个模态。把它放在document.ready函数中。

from django.conf.urls import url
from django.views.generic import TemplateView

import producer.views.pod_funnel as views

urlpatterns = [
    url(r'^dashboard/', views.dashboard, name="dashboard"),
    url(r'^clientsetup/', views.ClientSetupView.as_view(), name="clientsetup"),
    url(r'^podcastsetup/', views.PodcastSetupView.as_view(), name="podcastsetup"),
    url(r'^episodeinfo/$', views.EpisodeInfoView.as_view(), name="episodeinfo"),
    url(r'^episodeinfo/(?P<production_id>[0-9]+)/$', views.EpisodeInfoView.as_view(), name="episodeinfo_edit"),
    url(r'^episodeimagefiles/(?P<production_id>[0-9]+)/$', views.EpisodeImageFilesView.as_view(), name="episodeimagefiles"),

请务必将'#modal1'替换为您要打开的模态的ID。

答案 1 :(得分:-1)

我的代码是这样的:

$(document).ready(function(){
    $('#modal').modal().modal('open');
});