javascript - I want to add a css class selector to an onclick function in a vimeo-video slider/carousel plugin that came with a Timber template I bought -
want achieve: thumbnail gallery of video selections work playlist. each thumbnail clickable link load & play respective video in central screen above gallery. gallery player/slider above
and here's bit of js plugin, (i think) function clicking next: (demo link below)
var z = a('<a href="#" />').attr("id", "tms-prev").addclass("tms-arrow-nav").appendto(b), c = a('<a href="#" />').attr("id", "tms-next").addclass("tms-arrow-nav").appendto(b); z.each(function() { a(this).on("click", function(a) { a.preventdefault(), p.autoadvance && b.data("loaded") && y.resetslideshow(), y.prevslide() }) }), c.each(function() { a(this).on("click", function(a) { a.preventdefault(), p.autoadvance && b.data("loaded") && y.resetslideshow(), y.nextslide() }) }), p.lazyload && b.find(".tms-arrow-nav").css({ display: "block" }) }
what i've done: linked thumbnails use - href target="name" target iframe central player screen. since video player slider plugin, i've run slight conflict.
the problem: once integrated(my addition), video loads on second (of 3) slides on pause. user wouldn't know there, - when slider rotated clicking next arrow btn, video begins play slider's plugin function. fine if slider rotated user clicking play thumbnail. in fact, preferable effect.
solution i'm seeking: include classname thumbnail links in plugin's existing click function next slide button triggers rotation - adding classname $(this) of onclick function, clicking on thumbnail link in gallery not load video (as now) trigger slide rotate, provided slider plugin plays video when rotated (as now).
options: if problematic, can go disabling slider rotation altogether... if remove conflict begin video play.
codepen: doesn't seem work so, hosted demo online: demo of slider
1) video playing @ header on open not slider, slider below , directly above gallery , says slider caption on mountain icon. 2) top left thumbnail (2 narbonne) linked. when clicked, video load on 2nd slide buit wont seem happened. rotate next arrow , you'll see it. feel free use demo in way necessary - purpose.
Comments
Post a Comment