Implement waterfall stream Effect Based on JavaScript, and implement waterfall through javascript
The examples in this article share with you the specific code for js to implement waterfall stream effects for your reference. The specific content is as follows:
Front-End Content:
Use Javascript and four divs to put the photo into four Divs.
<! DOCTYPE html>
Background content:
Data Reading and processing of ajax requests based on Django FBV and function view
Def get_imgs (request): # obtain the number of Obtained photos index = request. GET. get ('nid') # obtain the QuerySet object, and obtain the data imgs_list = models from the 10 call after the index. student. objects. values ('id', 'img _ dir', 'name') [index: index + 10] imgs_list = list (imgs_list) # transfer status and data content ret = {'status': True, 'data': imgs_list} return JsonResponse (ret)
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.