when I click the right button in my slider it moves right, but after once moving right its neither moves right nor left

0 votes
Views.py File

def index(request):
    allProds = []
    catprods = Allmusic.objects.values('category', 'sno')
    cats = {item['category'] for item in catprods}
    for cat in cats:
        prod = Allmusic.objects.filter(category=cat)
        n = len(prod)
        nSlides = n // 4 + ceil((n / 4) - (n // 4))
        allProds.append([prod, range(1, nSlides), nSlides])
    params = {'allProds':allProds}
    return render(request,'index.html',params)

HTML File


<div class="container">
        <!--Slideshow starts here -->
        {% for product, range, nSlides in allProds %}
        <h5 class="my-4"><h2 id="headcat1">{{product.0.category}}<h2></h5>
        <div class="row">
            <div id="demo{{forloop.counter}}" class="col carousel slide my-3" data-ride="carousel">
                <ul class="carousel-indicators">
                    <li data-target="#demo{{forloop.counter}}" data-slide-to="0" class="active"></li>
                    {% for i in range %}
                    <li data-target="#demo{{forloop.parentloop.counter}}" data-slide-to="{{i}}"></li>
                    {% endfor %}
                </ul>

                <div class="container carousel-inner no-padding">
                    <div class="carousel-item active">
                        {% for i in product %}
                        <div class="col-xs-3 col-sm-3 col-md-3">
                            <div class="card" style="width: 18rem;">
                                <img src='/media/{{i.image}}' class="card-img-top" alt="...">
                                <div class="card-body">
                                    <h5 class="card-title" id="namepr{{i.id}}"><b>{{i.name}}<b></h5>
                                    <span id="divpr{{i.id}}" class="divpr">
                                        {% if user.is_authenticated %}
                                        <form action="/index/history" method="POST">
                                            {% csrf_token %}
                                            <input type="hidden" name="music_id" value="{{i.sno}}">
                                             <a href="/index/subpage/{{i.sno}}" class="btn btn-primary">Play Music</a>

                                         </form>
                
                                          {% endif %}
                                    </span>
                                </div>
                            </div>
                        </div>
                        {% if forloop.counter|divisibleby:4 and forloop.counter > 0 and not forloop.last %}
                    </div>
                    <div class="carousel-item">
                        {% endif %}
                        {% endfor %}
                    </div>
                </div>
            </div>

            <!-- left and right controls for the slide -->
            <a class="carousel-control-prev" href="#demo{{forloop.counter}}" data-slide="prev">
                <span class="carousel-control-prev-icon"></span>
            </a>
            <a class="carousel-control-next" href="#demo{{forloop.counter}}" data-slide="next">
                <span class="carousel-control-next-icon"></span>
            </a>
        </div>
        {% endfor %}
    </div>



{% endblock body %}
Oct 24 in HTML by Dhruvil
• 120 points
29 views

Hello @Dhruvil ,

Can you explain me with more details about your error you are facing so that I can help you out

Thank you!!

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In HTML

0 votes
1 answer

How to Identify Web Element( Button) when there are multiple buttons without any ID

Hi Gangadhar, Do you need the HTML code to ...READ MORE

answered Feb 10 in HTML by Roshni
• 5,990 points
258 views
+1 vote
1 answer

How can i create simple register form using html and css?

Html5 contains lots of elements using which ...READ MORE

answered Jan 31 in HTML by Niroj
• 76,540 points
1,301 views
0 votes
0 answers

How to do calculation in PHP using a csv file for retrieving data?

Morning, I have a csv file and i ...READ MORE

Feb 11 in HTML by anonymous
• 140 points
375 views
0 votes
1 answer

How to align a <div> to the middle (horizontally/width) of the page?

Hello Kartik, position: absolute and then top:50% and left:50% places the top edge ...READ MORE

answered Apr 23 in HTML by Niroj
• 76,540 points
57 views
0 votes
1 answer

HTML - Change\Update page contents without refreshing\reloading the page?

Hii kartik, onclick handlers run on the client side, ...READ MORE

answered Apr 23 in HTML by Niroj
• 76,540 points
9,113 views
0 votes
0 answers

I am trying to click the button but it is not working and it is drop list ..

<a class="quickreports btn btn3d tbbtn" href="javascript:" style="position:static" ...READ MORE

Dec 1, 2019 in Python by anonymous
• 120 points
180 views
0 votes
0 answers

@edureka! in my nodejs as its i have used it and pug also but my css doesn't worked as while running localhost it doesn't show styling of css

<!DOCTYPE html><html></html><head><style></style>@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap'); *{ margin: 0; box-sizing: border-box; padding: 0; } #navbar{ background-color:black; padding: 18px ...READ MORE

Jun 10 in Web Development by anonymous
• 120 points
126 views