Answer the question
In order to leave comments, you need to log in
Is it possible to find out the size of the container for the image dynamically?
In general, the problem is as follows: when creating news on the site, the user must upload a splash screen (picture) for this news. The news is created, checked by the moderator, goes to the news feed. What are some ways to compress images when they are rendered to the page to reduce the amount of data loaded? Asp.Net MVC 4 platform, there are several options, at least known to me:
<figure class="box-shadow-3">
<img src="@Url.Content(@Model.NewImages)" />
<figcaption class="text-white">
<div class="publication-date padding-all-10 border-right-bottom" title="Дата публикации">
<i class="fa fa-calendar"></i><span> @Model.NewDateAdd.ToShortDateString()</span>
</div>
<!-- /.publication-date -->
<div id="newAuthor" class="padding-all-10 col-md-8 border-left-top text-center">
<div class="col-md-8" title="Блог">
<i class="fa fa-rss"></i> @Model.BlogName
</div>
<!-- /.col-md-8 -->
<div class="col-md-4" title="Количество лайков">
<i class="fa fa-thumbs-up"> <span id="NewCountLikes">@Model.CountLikes</span></i>
</div>
<!-- /.col-md-4 -->
</div>
<!-- /#newAuthor -->
</figcaption>
<!-- /figcaption -->
</figure>
<!-- /figure -->
<figure>
figure {
width: 100%;
height: 400px;
position: relative;
}
figure img {
width: 100%;
height: 100%;
display: block;
}
Answer the question
In order to leave comments, you need to log in
If we are completely perverted, then the only way out is to load pictures with an ajax request. Only it is necessary?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question