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 25, 2020 in HTML by Dhruvil
• 120 points
575 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
0 answers

What's the right way to decode a string that has special HTML entities in it?

Let's say I submit a service request ...READ MORE

Jul 8 in HTML by Tejashwini
• 1,660 points
8 views
0 votes
0 answers

How to re-enable right click so that I can inspect HTML elements in Chrome?

I am currently seeing a web page ...READ MORE

Jul 21 in HTML by Ashwini
• 1,160 points
9 views
0 votes
0 answers

Get the query string value and display it in my html page

I can see the query string values ...READ MORE

Jul 21 in HTML by Ashwini
• 1,160 points
24 views
0 votes
0 answers

how to create a HTML5 video element without it being shown in the page?

how is it possible to dynamically create ...READ MORE

Jul 5 in HTML by Tejashwini
• 1,660 points
14 views
0 votes
0 answers
0 votes
0 answers

How can I change the line spacing for one paragraph in an HTML email template?

I want to add html commands that ...READ MORE

Jul 24 in HTML by Ashwini
• 1,160 points
21 views
0 votes
1 answer

trying to align html button at the center of the my page

For example: HTML <div> <button>Submit</button> </div> CSS button { margin:auto; ...READ MORE

answered Aug 4 in HTML by Deepak
• 760 points
15 views
0 votes
0 answers
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, 2020 in HTML by Roshni
• 10,500 points
794 views
0 votes
0 answers
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP