Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/370.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/91.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 转盘项目位置每天都在变化!!(Django,具体化)_Javascript_Html_Jquery_Css_Django - Fatal编程技术网

Javascript 转盘项目位置每天都在变化!!(Django,具体化)

Javascript 转盘项目位置每天都在变化!!(Django,具体化),javascript,html,jquery,css,django,Javascript,Html,Jquery,Css,Django,我的旋转木马/旋转木马项目尺寸与页面不匹配。我昨天把它放在1800px,导航栏和旋转木马之间没有空隙。现在有了。() 我不知道我会错在哪里。当我将转盘大小减小到900 px时,它会切断转盘项目的线路,如下所述 这是我的django模板中的html代码 {% load staticfiles %} {% load static %} {% load index %} <html lang="en"> <head> <meta nam

我的旋转木马/旋转木马项目尺寸与页面不匹配。我昨天把它放在1800px,导航栏和旋转木马之间没有空隙。现在有了。()

我不知道我会错在哪里。当我将转盘大小减小到900 px时,它会切断转盘项目的线路,如下所述

这是我的django模板中的html代码


{% load staticfiles %}
{% load static %}
{% load index %}

<html lang="en">
<head>

    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link rel="stylesheet" href="{% static 'style.css' %}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<nav>
    <div class="container nav-wrapper">
        <div class="flex-container">

        <h class="brand-logo center"><b>Today's Q/A</b></h>
        <ul id="nav-mobile" class="Center">
            <li><a href="/"></a></li>
        </ul>
    </div>
    </div>
</nav>


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<script>
    $(document).ready(function(){
    $('.carousel').carousel();
    });

autoplay()
function autoplay() {
    $('.carousel').carousel('next');
    setTimeout(autoplay, 4500);
}
</script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
{#<section class="black">#}

<style>
html,
body{
  background-color: #FEDCC8;
}
 .flex-container {
  display: flex;
       flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-evenly;

}
</style>

<div class="flex-container">

    <div class="container-fluid">
    <a class="btn waves-effect waves-light" href="/random_naturemetal_link">Cute Cat Pic <3
    <i class="large material-icons left">sentiment_neutral</i>
    <i class="large material-icons right">sentiment_very_satisfied</i>
    </a>
    </div>

    <div class="container-fluid">
    <a class="btn waves-effect waves-light" href="/random_cozy_link"> C O Z Y
    <i class="large material-icons left">favorite</i>
    <i class="large material-icons right">favorite</i>
    </a>
    </div>

    <div class="container-fluid">
    <a class="btn waves-effect waves-light" href="/random_sky_link"> Trippy Earth
    <i class="large material-icons left">camera</i>
    <i class="large material-icons right">flight_takeoff</i>
    </a>
    </div>
    </div>

{#</section>#}
<style>
.carousel
{
  height: auto !important;
}

.carousel-item
{
  display: flex;
    {#margin-top: -5%;#}
    width: 1050 !important;
    height: auto! important;
  align-items: space-evenly! important;
  justify-content: space-evenly! important;
}

</style>
<br>
<br>

<div class="container carousel">

{%for a, b in x|zip:z %}

    <div class="carousel-item black lighten-2 white-text" href="#">
      <div class="container">
      <br>

        <h3 class="align-center">{{a}}</h3>
       {% for i in b %}
          <p>{{ i }}</p>
           {%  endfor %}
            <div class ="container">
                <a href={{random_meme}}>
                <h3 class="">dank meme 4 u</h3>
                <br>
            </a>
            </div>
      </div>
    </div>
  {% endfor %}


</div>


{#    <div class="carousel-item red lighten-2 white-text" href={{random_meme}}>#}
{#            <div class ="container">#}
{#                <a href={{random_meme}}>#}
{#            <h2> dank meme 4 u</h2>#}
{#            </a>#}
{#            </div>#}
{##}
{#            <h1> Thanks for staying <br>#}
{#            <a href = {{random_meme}} target="_blank"> dank meme 4 u <3 </h1></a>#}
        </div>
    </div>

  </div>


</div>

</div>
<script>
    document.addEventListener('DOMContentLoaded', function() {
   var elems = document.querySelectorAll('.carousel');
   var instances = M.Carousel.init(elems, {
     indicators: true,
     padding: 200,
   });
 });
</script>


{#    </form>#}

    {% block content %}

    {% endblock content %}
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
</body>
</html>

{%load staticfiles%}
{%load static%}
{%load index%}
今天的问答
$(文档).ready(函数(){ $('.carousel').carousel(); }); 自动播放() 函数autoplay(){ $('.carousel')。carousel('next'); 设置超时(自动播放,4500); } {##} html, 身体{ 背景色:#FEDCC8; } .柔性容器{ 显示器:flex; 弯曲方向:行; 柔性包装:包装; 对正内容:空间均匀; } {##} 旋转木马 { 高度:自动!重要; } .传送带项目 { 显示器:flex; {#利润率最高:-5%#} 宽度:1050!重要; 高度:自动!重要; 对齐项目:间距均匀!重要; 调整内容:空间均匀!重要; }

{x中a,b的百分比| zip:z%}
{{a} {b%中的i的%s} {{i}

{%endfor%} {%endfor%} {# #} {# #} {# #} {# #} {##} {谢谢你留下来
} {# #} document.addEventListener('DOMContentLoaded',function(){ var elems=document.querySelectorAll('.carousel'); var instances=M.Carousel.init(elems{ 指标:正确, 填充:200, }); }); {# #} {%block content%} {%endblock内容%}
jsfiddle@jqueryHtmlCSS从DTL转换时无法复制转盘项目的for循环。在css旋转木马设置中真正感受到它的存在。将尝试在heroku上托管该网站,然后可能会有一个工作示例链接到此处。hi@jqueryHtmlCSS正如承诺的那样,网站ezqna.herokuapp.comMake a的pfb链接jsfiddle@jqueryHtmlCSS从DTL转换时无法复制转盘项目的for循环。在css旋转木马设置中真正感受到它的存在。将尝试在heroku上托管该网站,然后可能会有一个工作示例链接到此处。hi@jqueryHtmlCSS,如承诺的那样,网站ezqna.herokuapp.com的pfb链接