Home  >  Article  >  Web Front-end  >  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中世界最好的语言
php中世界最好的语言Original
2018-02-27 10:16:134188browse

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

loop || parent.on('click', options.img, function(){
       
      var othis = $(this), index = othis.attr('layer-index'); 
      layer.photos($.extend(options, {
        photos: {
          start: index,
          data: data,
          tab: options.tab
        },
        full: options.full
      }), true);
 pushData();
})
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);
})

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!

Statement:
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