asked    Wendy     2018-10-22       html       18 view        1 Answer

[SOLVED] First img of bannermover does not follow directly after last img of bannermove

I use the following code to create a bannermove:

.photobanner {
  height: 233px;
  width: 3550px;
  margin-bottom: 5px;
  font-size: 0;
}

.photobanner img {
  margin-bottom: 10px;
  margin-right: 5px;
  height: 233px;
  width: 350px;
}

.photobanner img {
  transition: all 0.5s ease;
}

.first {
  animation: bannermove 30s linear infinite;
}

@keyframes bannermove {
  0% {
    margin-left: 0px;
  }
  100% {
    margin-left: -2130px;
  }
}
<div class="photobanner">
  <img class="first" src="">
  <img src="">
  <img src="">
  <img src="">
  <img src="">
</div>

  1 Answer  

        answered    Jonas     2018-10-22      

I guess you means to this tutorial. The key sentence is:

What we need to do is make our first frame perfectly match our last frame

and for doing this you have to add more images so they will take the blank space.

.photobanner {
  height: 233px;
  width: 3550px;
  margin-bottom: 5px;
  font-size: 0;
}

.photobanner img {
  margin-bottom: 10px;
  margin-right: 5px;
  height: 233px;
  width: 350px;
}

.photobanner img {
  transition: all 0.5s ease;
}

.first {
  animation: bannermove 10s linear infinite;
}

@keyframes bannermove {
  0% {
    margin-left: 0px;
  }
  100% {
    margin-left: -1775px;
  }
}
<div class="photobanner">
  <img class="first" src="">
  <img src="">
  <img src="">
  <img src="">
  <img src="">
  
  <img src="">
  <img src="">
  <img src="">
  <img src="">
</div>




Your Answer





 2018-10-22         Edward

error :object can't be deleted because its id attribute is set to None

Trying to Delete an object using shell in django. How do i delete the object say "Ron"?I use the following command:t.delete('Ron') The error: object can't be deleted because its id attribute is set to NoneSuggests that you either never saved the object t in the first place, or you changed the primary key (here id) to None manually.If you have a single object you can perform a .delete() on the object, for example:my_obj = Model.objects.get(name='Ron')my_obj.delete()You should not add extra parameters to delete except for using and keep_parents, as specified in the docume...
 django                     1 answers                     93 view
 2018-10-22         Selena

Getting a Model dynamic by knowing its name

I use Django 2.1.I have a general utility/function(using celery) that I call from the save method of a Model(is an abstract Model, inherited by other Models).Because the data from the function will be serialize, I pass to it the Model name and PK.class A(models.Model) def save(self, *args, **kwargs): send_async(model_name=type(self).__name__, pk=self.id))class B(A)class C(A)Later, I want to query the Model, but I don't know how to get the Model:I tried: model = apps.get_model('django_app_name.{}'.format(model_name)) I get the following error:No installed app with labe...
 django                     3 answers                     95 view
 2018-10-22         Hugo

Django Rest Framework: How to implement a nested logic?

Let's say I have three models as:class User(AppModel): name = models.CharField(max_length=255)class Business(AppModel): owner = models.ForeignKey("User", related_name="businesses", on_delete=models.CASCADE) legal_name = models.CharField(max_length=255)class Invoice(AppModel): business = models.ForeignKey("Business", related_name="invoices", on_delete=models.CASCADE) amount = models.integerField()As you can see, a user can have multiple businesses and a business can have multiple invoices.My serializers.py:class UserSerializer(serializers.ModelSerializer): ...
 python                     2 answers                     94 view