Speed of loading some images from one source - html

For example I have three images with the same source like this:
<img src="img_girl.jpg" alt="Girl in a jacket" width="250" height="300">
<img src="img_girl.jpg" alt="Girl in a jacket" width="500" height="600">
<img src="img_girl.jpg" alt="Girl in a jacket" width="1000" height="1200">
Would they beeing loading the same amount of time like three images with different sources?

Related

How to preload images using CSS?

I'm trying to implement this code to preload images, but it isn't working.
Add CSS:
div#preload { display: none; }
In the footer within the </body> tag:
<div id="preload">
<img src="http://gearenergy.com/wp-content/uploads/2018/04/Home-Banner-final.jpg" width="1140px" height="500px" alt="Home-Banner_01" />
<img src="http://gearenergy.com/wp-content/uploads/2018/04/front-page-background.jpg" width="550px" height="400px" alt="PresentationBG_02" />
<img src="http://gearenergy.com/wp-content/uploads/2018/07/orange-color-overlay.png" width="600px" height="600px" alt="FinanceReportBG_03" />
<img src="http://gearenergy.com/wp-content/uploads/2018/04/front-page-background-blue.jpg" width="550" height="400" alt="LatestNewsBG_04" />
</div>
Obviously I've replaced the HTML and repointed to the images, but it's still not working.
Personally I would use JavaScript in this case. But if you want only CSS you can preload all images in a div tag which is positioned in hidden part of window like follows:
#preload
{
position:absolute;
top:-9999px;
left:-9999px;
}
<div id="preload">
<img src="http://gearenergy.com/wp-content/uploads/2018/04/Home-Banner-final.jpg" width="1140px" height="500px" alt="Home-Banner_01" />
<img src="http://gearenergy.com/wp-content/uploads/2018/04/front-page-background.jpg" width="550px" height="400px" alt="PresentationBG_02" />
<img src="http://gearenergy.com/wp-content/uploads/2018/07/orange-color-overlay.png" width="600px" height="600px" alt="FinanceReportBG_03" />
<img src="http://gearenergy.com/wp-content/uploads/2018/04/front-page-background-blue.jpg" width="550" height="400" alt="LatestNewsBG_04" />
</div>

Adding Link to image in slideshow cycle2 or pager

I need to add a link to images in my slideshow(cycle2) which is also setup with a pager. How do I do that without knocking the image down of the slider??
<div
id="slideshow" class="cycle-slideshow"
data-cycle-manual-fx="scrollHorz"
data-cycle-pager-fx="fade"
data-cycle-manual-speed="400"
data-cycle-prev="#prev"
data-cycle-next="#next"
data-cycle-speed="600"
data-cycle-timeout="3000"
data-cycle-pager = "#pager"
data-cycle-pager-template="<a href='#'><img src='{{src}}' width=150 height=100></a>">
<img src="bear scene.jpg" alt=""/>
<img src="someimage.jpg" alt=""/>
<img src="otherimage.jpg" alt=""/>
<img src="picute.jpg" alt=""/>
<img src="somethingelse.jpg" alt=""/>
<img src="anotherpic_.jpg" alt=""/>
<img src="lastpic.jpg" alt=""/>
</div>
If you do not want to mess up with the css (which you need to do if you wrap the images in <a> tags) you can just use javascript onclick event for the images to open a link from the images like this:
<img onclick="window.open('http://www.google.com', '_blank')" src="bear scene.jpg" alt=""/>
Here are some examples: https://jsfiddle.net/2jjomuge/

XPath to select src attribute in iMacro for Firefox not working?

<div class="product-thumbnails" data-show="5">
<div href="http://cdn.palmgren.com/images/products/9661051.jpg"
class="item-image" title="">
<img width="100" height="128"
src="http://cdn.palmgren.com/images/thumbnails/9661051.jpg" alt=""/>
</div>
<div href="http://cdn.palmgren.com/images/products/9661101_death_stop.jpg"
class="item-image" title="">
<img width="100" height="128" src="" alt=""/>
</div>
</div>
I have written the code below to extract src i.e. http://cdn.palmgren.com/images/thumbnails/9661051.jpg but it is not working. Please help me to correct the code.
TAG XPATH="//div[#class="product-thumbnails"]/div[1]/img" EXTRACT=src
This XPath (adding a /#src to your original)
//div[#class="product-thumbnails"]/div[1]/img/#src
will select
http://cdn.palmgren.com/images/thumbnails/9661051.jpg
as requested.

CSS: Float Image [duplicate]

This question already has answers here:
Why doesn't the height of a container element increase if it contains floated elements?
(7 answers)
Closed 8 years ago.
Why does the float:left and float:right element cause my web page to become squashed?
This is what happens when I try to float:left or float:right.
http://prntscr.com/3fx03d
The page seems to forget the images take up space on the page
The only way to fix this is to use "<p>...</p>" at the very bottom of the images in the HTML Code then it will look like this.
http://prntscr.com/3fx13l
What is going on here?
Yes I have ensured to specify the size of the images beforehand.
HTML
<div id="main-content">
<h2>Images</h2>
<div class="images">
<img src="images/Home_Pic1.jpg" alt="Motivational Image" width="250" height="150">
<img src="images/Img_Pic2.png" alt="Motivational Image" width="250" height="150">
<img src="images/Img_Pic3.png" alt="Motivational Image" width="250" height="150">
<img src="images/Img_Pic4.png" alt="Motivational Image" width="250" height="150">
<img src="images/Img_Pic5.png" alt="Motivational Image" width="250" height="150">
<img src="images/Img_Pic6.png" alt="Motivational Image" width="250" height="150">
<img src="images/Img_Pic7.png" alt="Motivational Image" width="250" height="150">
<img src="images/Img_Pic9.png" alt="Motivational Image" width="250" height="150">
<img src="images/Img_Pic8.png" alt="Motivational Image" width="250" height="150">
<img src="images/Img_Pic10.png" alt="Motivational Image" width="250" height="150">
<img src="images/Img_Pic11.png" alt="Motivational Image" width="250" height="150">
<img src="images/Img_Pic12.png" alt="Motivational Image" width="250" height="150">
</div>
<p align="center">...</p>
</div>
<footer>
<p>© Copyright 2014 All rights reserved </p>
<ul>
<li><img src="images/rss.png" width="16" height="16" /></li>
<li><img src="images/facebook.png" alt="Facbook" width="16" height="16" /></li>
<li><img src="images/twitter.png" alt="Twitter" width="16" height="16" /></li>
<li><img src="images/share.png" width="16" height="16" /></li>
<li><img src="images/bloggr.png" width="16" height="16" /></li>
<li><img src="images/google-plus.png" width="16" height="16" border="0" /></li>
</ul>
</footer>
</div> <!--end of wrapper-->
CSS:
div.images{
position:relative;
left:0px;
float:left;
width:765px;
margin:0px -5px;
}
If I am understanding your problem correctly, in a nutshell, floated elements do not add height to the container. There are a number of ways to correct this behavior. Float the parent element, specify overflow: hidden on the parent or use a clearfix hack http://css-tricks.com/snippets/css/clear-fix/.
There is a pretty indepth article on this here at stackoverflow:
Why doesn't the height of a container element increase if it contains floated elements?

Tumblr: Best way to display photos with proper dimensions

I would like my template to have different dimensions for a photo, based on it being a portrait or landscape image.
For example:
if (dimensions == landscape)
{LinkOpenTag}
<img src="{PhotoURL-500}" width="800" height="600" class="photo" alt="{PhotoAlt}" />
{LinkCloseTag}
else
{LinkOpenTag}
<img src="{PhotoURL-500}" width="600" height="800" class="photo" alt="{PhotoAlt}" />
{LinkCloseTag}
Sadly you can't work out if an image is landscape / portrait from Tumblr theme operators alone. You would need to use javascript to work this out.
However, I question why you would need to know this as both the following would display an image, in its natural size / orientation:
{LinkOpenTag}
<img src="{PhotoURL-500}" class="photo" alt="{PhotoAlt}" />
{LinkCloseTag}
Or:
{LinkOpenTag}
<img src="{PhotoURL-500}" width="{PhotoWidth-500}" height="{PhotoHeight-500}" class="photo" alt="{PhotoAlt}" />
{LinkCloseTag}
Reference: http://www.tumblr.com/docs/en/custom_themes#photo-posts