rofli123 Posted January 18, 2017 Share Posted January 18, 2017 (edited) Hi, Under product pic there is #thumbs_list with all product image thumbnail. There is also #view_scroll_right and left button that slide thumbs when clicked. I want another button I have added to do the same but I don't know how. I have looked at product.js but it's very confusing. There is only: function serialScrollFixLock(event, targeted, scrolled, items, position) { var serialScrollNbImages = $('#thumbs_list li:visible').length; var leftArrow = position == 0 ? true : false; var rightArrow = position + serialScrollNbImagesDisplayed >= serialScrollNbImages ? true : false; $('#view_scroll_left').css('cursor', leftArrow ? 'default' : 'pointer').css('display', leftArrow ? 'none' : 'block').fadeTo(0, leftArrow ? 0 : 1); $('#view_scroll_right').css('cursor', rightArrow ? 'default' : 'pointer').fadeTo(0, rightArrow ? 0 : 1).css('display', rightArrow ? 'none' : 'block'); return true; } and $('#thumbs_list').serialScroll({ items:'li:visible', prev:'#view_scroll_left', next:'#view_scroll_right', axis:'x', offset:0, start:0, stop:true, onBefore:serialScrollFixLock, duration:700, lazy: true, lock: false, force:false, cycle:false }); Very confusing. What function slides the thumbs? so that I can easily: $('#mybutton').click(function(){ SlideThumbs(); }); How could this be done easily? Thanks! Edited January 19, 2017 by rofli123 (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted January 18, 2017 Share Posted January 18, 2017 Do you want it to replace the defaults? If so just use its id in that serialscroll options object.If not, you can just call $('#view_scroll_right')click(); and it should work anyway Link to comment Share on other sites More sharing options...
rofli123 Posted January 19, 2017 Author Share Posted January 19, 2017 For some reason triggering it like this $("#view_scroll_left").trigger("click"); wouldn't work, however changing the serialScroll function worked. Thank you NemoPS! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now