jQuery Scrollable (with the navigator plugin) is showing the wrong slide when it first loads.
It behaves normally when I use it like this:
$(".scrollable").scrollable({}).navigator();
…but as soon I enable the 'circular' mode (to allow looping from the final slide back to the first):
$(".scrollable").scrollable({ circular: true }).navigator();
on page load, the final item is the first one show, even though item 1 is highlighted in the navigator. If you go through the images, when you get to the final one, it's shown a second time, and you only see the actual first image at the beginning of the second loop.
Any suggestions?
Here's my HTML for completeness:
<div class="column two-thirds scrollable" id="scrollable">
<a class="prev browse left">Previous</a>
<div class="items">
<div><img src="1.jpg" alt="" /></div>
<div><img src="2.jpg" alt="" /></div>
<div><img src="3.jpg" alt="" /></div>
<div><img src="4.jpg" alt="" /></div>
</div>
<a class="next browse right">Next</a>
<div class="naviWrapper">
<div class="navi"></div>
</div>
</div>
Here is a link to the same issue, suggesting that you replace your <img> tags with <div> tags that have a background image.
https://github.com/jquerytools/jquerytools/issues/47
I could not do that as some of my images had image maps. However, all my images had the same dimensions, so I put in image dimensions, i.e.
<img width=730 height=360 alt="first image" src="/images/my-image.jpg" />
And that seems to have solved it.
Related
I want to resize images on this page.
They have exactly the same properties and code but the first one is has width: auto.
This is the code of the first image (baby boy):
<div class="wp-block-image">
<figure class="aligncenter is-resized">
<img src="https://milkandmotherhood.com/wp-content/uploads/418900_10152030658650634_1604957331_n.jpg" alt="baby boy sleeping" class="wp-image-821" width="512" height="540"/>
</figure>
</div>
Here's the code of the second image (family):
<div class="wp-block-image">
<figure class="aligncenter is-resized">
<img src="https://milkandmotherhood.com/wp-content/uploads/414572_10101518238988742_677706630_o.jpg" alt="Family on the meadow smiling" class="wp-image-822" width="512" height="341"/>
</figure>
</div>
Both are the same, yet the first image has width:auto at the webpage.
What should I change?
my image does not display as the true size, I've also tried to embed height and width but that does not work either. any idea of the proper code to get my .png to display as the original size?
my code is ----->
<div class="divPanel notop nobottom">
<div class="row-fluid">
<div class="span12">
<div id="divLogo" class="center">
<a href="index-alt.html" id="divSiteTitle">
<img src="images/logo.png" alt="Tech Mule" class="img-circle" title="Tech Mule"/>
</a>
</div>
</div>
</div>
</div>
I'm new to html/css and am trying to make a straight-forward webpage, which is just several images centered horizontally, each on their own row. I ended up using Bootstrap's basic html template, and can't figure out what's wrong with the code below. My images are stuck on the left edge of the page. The only CSS I'm currently using is the default linked one: "css/bootstrap.min.css"
This is all that's currently in my body:
<div class=“container-fluid”>
<div class=“row”>
<img src="..." class=“img-responsive center-block”>
</div>
<div class=“row”>
<img src="..." class=“img-responsive center-block”>
</div>
</div>
Your quotation marks ("") seem to be broken in your img's class. Don't know what your actually using but change them to normal quotation marks and it should work.
<div class="container-fluid">
<div class="row">
<img src="..." class="img-responsive center-block">
</div>
<div class="row">
<img src="..." class="img-responsive center-block">
</div>
</div>
I'm trying to conditionally display an image with ng-style.
I've tried all the suggestions listed here (and in the docs) but nothing seems to work.
first try:
<br/>
<img alt="" ng-style="{'background-image':'url(\'https://www.google.com/images/srpr/logo4w.png\')'}">
<br/>
second try:
<br/>
<img src="" alt="" ng-style="{'background-image':'url(\'https://www.google.com/images/srpr/logo4w.png\')'}">
<br/>
third try:
<br/>
<img src="" alt="" ng-style="{background-image:'url(https://www.google.com/images/srpr/logo4w.png)'}">
<br/>
fourth try:
<br/>
<img src="" alt="" ng-style="{background:'url(https://www.google.com/images/srpr/logo4w.png)'}">
Here's a JSFiddle
The background-image doesn't make sense with the <img> element so you need to use ng-src instead of ng-style.
Also, you're missing the ng-app attribute in your example so Angular isn't actually running.
So a working example would be:
<div ng-app>
<img ng-src="https://www.google.com/images/srpr/logo4w.png">
</div>
Although, I guess you can use ng-style on other elements, like a div. Just make sure it has content in it so the background actually shows up:
<div ng-app>
<div style="padding: 20px;" ng-style="{'background-image':'url(\'https://www.google.com/images/srpr/logo4w.png\')'}">This is some content</div>
</div>
I am trying to affix a callout image to the top right of a page, but I do not want it moving once the screen is below a certain width or else it will begin to overlap other page elements. Does anyone know what the best way of going about this is? Thanks!
Standard CSS practises tell us that each element on the page should be encapsulated as a block:
<div style="float:left;">
<div style="float:left;">
<img src="picture.png" />
</div>
</div>
This kind of style allows elelments to stack on top of one another, preventing overlap.
In your case, it sounds like you have a header, and you need a picture fixed in the top right:
<div id="header" style="width:100%;float:left;">
<div style="float:right;">
<img src="picture.png" />
</div>
</div>
<!-- continue stacking elements to build your page -->
<div id="content" style="width:100%;float:left;">
Hey, this stuff works!
</div>
But you also mentioned your page should have a min width, so that when a user tries to contract the width, elements do not overlap horizontally:
<body style="min-width:800px;">
<div id="header" style="width:100%;float:left;">
<div style="float:right;">
<img src="picture.png" />
</div>
</div>
<!-- continue stacking elements to build your page -->
<div id="content" style="width:100%;float:left;">
Hey, this stuff works!
</div>
</body>