Flex Slider, when synced skips 2nd thumbnail - apache-flex

I'm using 2 FlexSlider2's synced so one acts as a thumbnail carousel nav for the main slider. I have slideshow set to true on the main slide show and false on the slider synced as navigation. Everything works smoothly, except that FlexSldier2 doesn't add an active class to the 2nd slide in the thumbnav, it just skips right voer it. The large main image transitions fine however. I've searched all voer and this is the only thing related, however there is no answer there either: https://github.com/woothemes/FlexSlider/issues/331.
Below is my code, the JS and the HTML. Please let me know if anyone else has ever experienced this as I am at a loss.
<script>
$(window).load(function() {
// The slider being synced must be initialized first
$('#thumbslide').flexslider({
animation: "slide",
controlNav: false,
directionNav: true,
animationLoop: true,
slideshow: false,
itemWidth: 250,
itemMargin: 15,
asNavFor: '#mainslide',
});
$('#mainslide').flexslider({
animation: "fade",
controlNav: false,
directionNav: true,
animationLoop: true,
slideshow: true,
initDelay: 50,
slideshowSpeed: 6000, //Integer: Set the speed of the slideshow cycling, in milliseconds
animationSpeed: 600,
sync: "#thumbslide"
});
});
<div class="slidewrap">
<div id="mainslide" class="flexslider">
<ul class="slides">
<li> <img src="/images/slide1.png" /> </li>
<li> <img src="/images/slide2.png" /> </li>
<li> <img src="/images/slide3.png" /> </li>
<li> <img src="/images/slide4.png" /> </li>
<li> <img src="/images/slide5.png" /> </li>
<li> <img src="/images/slide6.png" /> </li>
</ul>
</div>
<div id="thumbslide" class="flexslider">
<ul class="slides">
<li> <img src="/images/thumb1.jpg" /> <img src="/images/red.png" class="redpic" /> </li>
<li> <img src="/images/thumb2.jpg" /> <img src="/images/red.png" class="redpic" /> </li>
<li> <img src="/images/thumb3.jpg" /> <img src="/images/red.png" class="redpic" /> </li>
<li> <img src="/images/thumb4.jpg" /> <img src="/images/red.png" class="redpic" /> </li>
<li> <img src="/images/thumb5.jpg" /> <img src="/images/red.png" class="redpic" /> </li>
<li class="last"> <img src="/images/thumb6.jpg" /> <img src="/images/red.png" class="redpic" /> </li>
</ul>
</div>

I think that's because of itemWidth and itemMargin. If you replace "itemWidth: 250," with "itemWidth: 265," (265 = 250 + 15(which is the itemMargin)), the problem should be solved. It worked for me.

This is an issue with Flexslider itself.
In the "canAdvance" function [line 797 of Flexslider version 2.2.0], just change slider.pageCount to slider.count

Related

initial mobile screen doesn't scroll

The template i'm using doesn't allow scrolling on load. You can only touch scroll after you have selected a collapsed menu item. Once you scroll back to the top it "locks" again (so-to-speak).
The main area that seems to be unscrollable is a slider. Can anyone tell me what I need to do to make this site be scrollable on load?
Any information is greatly appreciated.
The site is here... http://www.slicemfg.com
<div id="home">
<div class="tp-banner-container">
<div class="tp-banner" >
<ul>
<!-- THE FIRST SLIDE -->
<li data-transition="zoomout" data-slotamount="4" data-masterspeed="700">
<img src="images/1.jpg" alt="" /> }
<!-- THE CAPTIONS IN THIS SLIDE -->
<div class="caption big-text lft"
data-x="center"
data-y="350"
width="10px"
data-speed="700"
data-start="700"
data-easing="easeOutExpo">
<div class="big-text"><span4>YOUR IDEAS REALIZED</span4></br><div><a class="button3 scroll" href="#contact">CONTACT US</a></div></div>
</div>
</li>
<li data-transition="zoomout" data-slotamount="1" data-masterspeed="700">
<img src="images/14.jpg" alt="" />
<div class="just_pattern"></div>
<div class="caption big-text lft"
data-x="center"
data-y="center"
data-speed="700"
data-start="700"
data-easing="easeOutExpo"><div class="big-text"><span4>YOUR IDEAS REALIZED</span4></br><div><a class="button3 scroll" href="#contact">CONTACT US</a></div></div>
</div>
</li>
<li data-transition="zoomout" data-slotamount="1" data-masterspeed="700">
<img src="images/07.jpg" alt="" />
<div class="just_pattern"></div>
<div class="caption big-text lft"
data-x="center"
data-y="center"
data-speed="700"
data-start="700"
data-easing="easeOutExpo"><div class="big-text"><span4>YOUR IDEAS REALIZED</span4></br><div><a class="button3 scroll" href="#contact">CONTACT US</a></div></div>
</div>
</li>
<li data-transition="zoomout" data-slotamount="1" data-masterspeed="700">
<img src="images/04.jpg" alt="" />
<div class="just_pattern"></div>
<div class="caption big-text lft"
data-x="center"
data-y="center"
data-speed="500"
data-start="500"
data-easing="easeOutExpo"><div class="big-text"><span4>YOUR IDEAS REALIZED</span4></br><div><a class="button3 scroll" href="#contact">CONTACT US</a></div></div>
</div>
</li>
</ul>
</div>
</div>
</div>
To fix this issue, you need to add touchenabled:"off", to your revolution config.
Your config should now look like this:
(function($) { "use strict";
var revapi;
jQuery(document).ready(function() {
revapi = jQuery('.tp-banner').revolution(
{
delay:5000,
startwidth:2000,
startheight:500,
soloArrowRightVOffset:50,
soloArrowLeftVOffset:50,
hideThumbs:0,
onHoverStop:"off",
navigationType: "none",
fullWidth:"off",
fullScreen:"on",
fullScreenOffsetContainer: "",
touchenabled:"off" //Disable touch events.
});
}); //ready
})(jQuery);

popover on hover in wordpress

I want popover on hover of product images in WordPress, i used popover.js also include js and css of bootstrap. my WordPress theme has included bootstrap.
here is my product image code,
<img class="alignnone size-full wp-image-134" src="Projektorer-research.jpg" alt="Projektorer-research" width="268" height="150" />
here i used data-content="test" for example, actually i want to display unordered list over there.
Are you initializing your Popovers? You must initialize them yourself with JS like in the example Snippet.
See docs working example.
$(function() {
$('[data-toggle="popover"]').popover();
});
body,
html {
margin: 50px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<a href="#" data-toggle="popover" data-trigger="hover" data-content="test">
<img class="alignnone size-full wp-image-134" src="http://placehold.it/350x150" alt="..." width="268" height="150" />
</a>
i think you are trying to display custom(html) content in your popover, if you do like below you can set any content in your popover.
<div id="popover_content" class="row company-logo" style="display: none">
<ul>
<li><img src="images/alico-logo.png" alt=""/></li>
<li><img src="images/national.png" alt=""/></li>
<li><img src="images/traveller.png" alt=""/></li>
<li><img src="images/progressive.png" alt=""/></li>
<li><img src="images/formost.png" alt=""/></li>
<li><img src="images/the.png" alt=""/></li>
<li><img src="images/circle.png" alt=""/></li>
</ul>
</div>
<a id="popx" type="button" class="btn btn-lg btn-danger" data-toggle="popover" title="Popover title" data-content="">Click to toggle popover</a>
and initialize your popover like this:
<script>
$(function () {
$('#popx').popover({
html: true,
content: function () {
return $('#popover_content').html();
}
});
;
})
</script>

How to add a different background color in my active button?

I'm trying to give a different background-color to my button when it is active. The HTML code is as below.
<div class="tabs">
<div class="tab-content">
<div id="tab1" class="tab active">
<!-- some content -->
</div>
<div id="tab2" class="tab">
<!-- some content -->
</div>
<div id="tab3" class="tab">
<!-- some content -->
</div>
<ul class="tab-links">
<li class="active">
<a href="#tab1"><span class="numer_viti">bla bla</span>
<p class="arrow-up"><p class="cmimet_ne_vite">BUTTON ACTIVE</p></p></a>
</li>
<li>
<a href="#tab2"><span class="numer_viti">bla bla</span>
<p class="arrow-up"><p class="cmimet_ne_vite">BUTTON</p></p></a>
</li>
<li>
<a href="#tab3"><span class="numer_viti">bla bla</span>
<p class="arrow-up"><p class="cmimet_ne_vite">BUTTON</p></p></a>
</li>
</ul>
</div>
</div>
I used both this codes in my CSS files and i didn't sow nothing happened:
This is the CSS code for my project:
.cmimet_ne_vite:active
{
background:#787878;
}
.cmimet_ne_vite.active
{
background:#787878;
}
So who knows were is the problem to help me resolve it?
You have no element with both classes "cmimet_ne_vite" and "active". Instead you have a .cmimet_ne_vite element which is a descendant of your .active element, so instead of .cmimet_ne_vite.active you'll need to use:
.active .cmimet_ne_vite {
background:#787878;
}
Furthermore, you cannot wrap two <p> elements within each other. The browser will render this as two separate elements. Change:
<p class="arrow-up">
<p class="cmimet_ne_vite">BUTTON</p>
</p>
To:
<p class="arrow-up">
<span class="cmimet_ne_vite">BUTTON</span>
</p>
Or something similar.
Finally, if this element is intended to be used as a button you'll need to give it a role attribute set to "button":
<span class="cmimet_ne_vite" role="button">BUTTON</span>

Block level link HTML5 article

I was asking if the following is possible. I have a HTML5 article tag, with inside that a figure and figcaption tags. The caption is overlapping the image. The figure should be clickable, but I want some other links in the caption that linked to another page, like a categorie page.
How should my markup looks like.
Now I have the following, but than the a first a tag will be immediately closed after it's opening the a tag.
<li class="grid_12 blog-post">
<a href="#">
<figure class="post-thumb">
<img src="images/blog-thumb.png" alt="Post thumbnail">
<figcaption class="entry-post">
<span class="capitalize">Entry</span>
<h1 class="entry-title">
Fris. Responsive. Retina Ready.
</h1><!-- End h1 .entry-title -->
<ul class="entry-meta">
<li class="author">
By Casper Biemans
</li>
<li class="published">
On September 1, 2012
</li>
<li class="entry-categories">
In Digital Art
</li>
<li class="comment-count">
With 22 Comments
</li>
<li class="permalink">
<img src="images/permalink_icon.png" alt="Permalink post">Permalink
</li>
</ul><!-- End ul.entry-meta -->
</figcaption><!-- End figcaption.entry-post -->
</figure><!-- End figure.post-thumb -->
</a>
</li><!-- End li.grid_12 blog-post -->

How to prevent page jump when using # href to swap gallery images using a div ID?

I have been struggling with a problem for a while now. I've made a simple html gallery using CSS and a # href to essentially swap out different div ID's containing gallery images. The problem is that when you select the "next" or "previous" buttons in the gallery it jumps the page up in the browser so the gallery is aligned at the top of the page. Does anybody have any ideas how to prevent this?
Here is what the code for the gallery looks like:
<div id="pic1">
<img src="click/pic1.jpg" alt="" />
<a class="previous" href="#pic10"><b>Previous</b></a><a class="next" href="#pic2"><b>Next</b></a>
</div>
<div id="pic2">
<img src="click/pic2.jpg" alt="" />
<a class="previous" href="#pic1"><b>Previous</b></a><a class="next" href="#pic3"> <b>Next</b></a>
</div>
<div id="pic3">
<img src="click/pic3.jpg" alt="" />
<a class="previous" href="#pic2"><b>Previous</b></a><a class="next" href="#pic4"><b>Next</b></a>
</div>
<div id="pic4">
<img src="click/pic4.jpg" alt="" />
<a class="previous" href="#pic3"><b>Previous</b></a><a class="next" href="#pic5"> <b>Next</b></a>
</div>
<div id="pic5">
<img src="click/pic5.jpg" alt="" />
<a class="previous" href="#pic4"><b>Previous</b></a><a class="next" href="#pic6"><b>Next</b></a>
</div>
<div id="pic6">
<img src="click/pic6.jpg" alt="" />
<a class="previous" href="#pic5"><b>Previous</b></a><a class="next" href="#pic7"><b>Next</b></a>
</div>
<div id="pic7">
<img src="click/pic7.jpg" alt="" />
<a class="previous" href="#pic6"><b>Previous</b></a><a class="next" href="#pic8"><b>Next</b></a>
</div>
<div id="pic8">
<img src="click/pic8.jpg" alt="" />
<a class="previous" href="#pic7"><b>Previous</b></a><a class="next" href="#pic9"><b>Next</b></a>
</div>
<div id="pic9">
<img src="click/pic9.jpg" alt="" />
<a class="previous" href="#pic8"><b>Previous</b></a><a class="next" href="#pic10"><b>Next</b></a>
</div>
<div id="pic10">
<img src="click/pic10.jpg" alt="" />
<a class="previous" href="#pic9"><b>Previous</b></a><a class="next" href="#pic1"> <b>Next</b></a>
</div>
Any help would be greatly appreciated!
Instead of linking to #, link to javascript:void(0);
<a class="previous" href="javascript:void(0);">Next</a>
Or, prevent the default event with Javascript
$("a.previous, a.next").on("click", function(e) {
e.preventDefault();
});
You will need to use JQuery after you set
<a class="previous" href="javascript:void(0);">Next</a>
then call the JS:
$(document).ready(function(){
$('a.previous').click(function(e){
var picID= parseInt($(this).parent().attr("id").substr(3));//gets the pic id count
$("#pic"+(picID)).hide(); //hide the current div
$("#pic"+(picID-1)).show(); //show the previous div
});
$('a.next').click(function(e){
var picID= parseInt($(this).parent().attr("id").substr(3)); //gets the pic id count
$("#pic"+(picID)).hide(); //hide the current div
$("#pic"+(picID+1)).show(); //show the previous div
});
});
see: http://jsfiddle.net/uZ6g5/

Resources