Hide next button in LightBox with javascript
I have several images on the page. They are all supposed to show in a lightbox but without the stupid Next button. Anyway to disable the next button in jquery/javascript? 开发者_运维知识库I can't disable it in CSS since that change will be global.
Thanks!
Changing the CSS didn't for me. This did:
Change: $('#lightbox-nav').show();
To: $('#lightbox-nav').hide();
in the lightbox .js file.
I'm using the .min version so I had to do a quick 'find' :)
Install the Firebug add on in firefox if you haven't already. Open your webpage and right click the element. In the html tab of firebug it should show the id of the element if it has one. If it doesn't have an id give it one. Then put this line of code in whatever method triggers the lightbox to show.
$("#youridhere").toggle(false);
If you have trouble with this provide me with some more information and I can give you a better answer.
function initLightBox() {
$('a.lightbox').each(function () { $(this).lightBox(); });
}
If you want to show lightbox on individual pictures use the .each() function to initialize the lightbox individually. Or use $('a.lightbox').lightbox(); to initialize the lightbox on a set of pictures (which will display Next and Prev buttons)
Add the css to hide them:
#lightbox-nav-btnPrev {
display: none;
}
#lightbox-nav-btnNext {
display: none;
}
Add this code to your CSS file:
.lb-nav {
display : none !important;
}
精彩评论