Hasan Hasan - 1 year ago 104
jQuery Question

Switch img src on slide

I am using Maximage 2 plugin for my web site background slider but if my slider is at third image i want change that image with my logo src.

It's my slider

<div id="maximage">
<img src="assets/img/slide-01.gif" class="img-responsive"/>
<img src="assets/img/slide-02.gif" class="img-responsive" />
<img src="assets/img/slide-03.gif" class="img-responsive" />

It's my logo

<img id="logo" src="assets/img/logo.svg" class="img-responsive" alt="">

Answer Source

You can invoke callback in maximage 'before' and 'after' transition happens!
Maximage has cycleOptions Object. According to official documentation, Here are all options you can pass with cycleOption object. enter image description here

Here is Fiddle.
In fiddle i'm changing Src of logo in 'after' callback, but you can do whatever you want to do in that function.
You can also use 'before' callback.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download