Wednesday, 15 July 2015

javascript - Images placed with .append() / .load() not taking on the styles they should be -


There are some types of "display containers" of my website, in which the content is used by .load () , which is selected based on the item. These display containers can be a few different states, which can be based on your viewing on mobile devices, such as some containers containing words spacing in all the containers, giving images in the breathing room or correcting the contents. Set to stop.

Now, if I include images in these containers from the beginning - it is that they are part of the initial domus - everything looks okay with the word-spacing If it is a state in which the containers are called, or if you are on mobile then the material will be appropriate.

The problem is, when the content is added to these containers, whether it is to carry .load () from a different document, where it is stored Is going, or .append () , it is not taking on these properties.

I have made a bela shown. Unfortunately, I can not show the .load () function due to being able to use it only on the same domain () pages, but you can still see what I'm talking about I am .append () towards things

In short;

Images in the DOM initially work image details enter here added to the DOM / Loaded images Enter image details here When the mix (some elements are initialized, some elements are added) This is also true for images placed in their different ways. Enter image details here

If you examine the source of the initial / loaded mix All the elements look similar, first there are 2 images which keep proper spacing, while the rest do not have it.

Enter image details here

< Div class = "post-text" itemprop = "text">

If you add some space between images, then when adding them, will treat images like "words" and apply the space.


No comments:

Post a Comment