how to get a upsliding caption at bottom for the jquery accordion image slider of kwicks

妖精的绣舞 提交于 2019-12-10 23:38:30

问题


I am using this accordion slider.

Everything is okay except I need for each of the images , individual text that will sit at the bottom of the respective image on a certain background (i.e. gray). While an image is being displayed, that text with the background will just slide up on the image. The height of the text part will be small (if the image height is 250px , then the text part height can be 50 px ).

Anybody out there just to tell which part of the js and html to be modified and in which way?

Sliding up effect or placing a text over an image is quite easy but I am looking for the solution in the case of a not-so-small (in my view at least ) script .


回答1:


You'll need to use an updated version of Kwicks one which has callbacks.

Then add the captions, css to position the captions and the following callback code (here is a demo):

$('#demo').kwicks({

    // event called before kwicks expanding animation begins
    expanding: function(kwick) {
        kwick.$kwicks.find('.caption').stop(true,true).slideUp();
        kwick.$active.find('.caption').stop(true,true).slideDown();
    },
    // event called before kwicks collapsing animation begins
    collapsing: function(kwick) {
        kwick.$kwicks.find('.caption').stop(true,true).slideUp();
    }

});


来源:https://stackoverflow.com/questions/11351293/how-to-get-a-upsliding-caption-at-bottom-for-the-jquery-accordion-image-slider-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!