Home > Web Front-end > JS Tutorial > How to solve the problem of abnormal display after layer.photos() asynchronously modifies the image address

How to solve the problem of abnormal display after layer.photos() asynchronously modifies the image address

php中世界最好的语言
Release: 2018-02-27 10:16:13
Original
4232 people have browsed it

This time I will show you how to solve the problem of abnormal display after layer.photos() asynchronously modifies the picture address, and how to solve the problem of abnormal display after layer.photos() asynchronously modifies the picture addressNotes What are the actual cases? Let’s take a look at them.

There is a picture in the project that has a preview (using layer.photos()). The picture address needs to be modified asynchronously. However, after a successful modification, the first preview will display the large picture before modification, and the second time after that. Everything is normal.

After trying to modify successfully, calling layer.photos() again has no effect.

Change the

in the layer.

js

file to

loop || parent.on('click', options.img, function(){
    pushData();
  var othis = $(this), index = othis.attr('layer-index'); 
  layer.photos($.extend(options, {
    photos: {
      start: index,
      data: data,
      tab: options.tab
    },
    full: options.full                                                                                  
  }), true);
})
Copy after login

I believe you have mastered the method after reading these cases. Please pay attention for more exciting things. Other related articles on php Chinese website!

Related reading:

Summary of the box model in HTML

What should be the baseline of each type of box in HTML? Determine the importance of

overflow scrolling

CSS pseudo-class selector

The above is the detailed content of How to solve the problem of abnormal display after layer.photos() asynchronously modifies the image address. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template