jquery - fancybox - custom button -
I am trying to add a custom button to the button assistant of FancyBox 2. The new button looks okay, but I can not find anyone with click behavior ... on binding click does nothing but what is the secret to add your own button with this?
To click here, I'm just trying to see if it works or not. Nothing happens. Include
// screenshot $ (". Fancybox-screenshots"). Fancybox (function: 'none', next effect: 'none', helper: {title: {type: 'inside'}, button: {}}, after display: function () {$ ('# fancybox- Button '). ("Click", "#btnTest", function (event) {event.preventDefault (); warning (' test ');})}} // afterShow}); The output of this button assistant is:
& lt; Div id = "fancybox-buttons" class = "top" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; One class = "BTN Pratt" href = "javascript:;" Title = "Previous" & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; One class = "btnplay" href = "javascript:;" Title = "start a slide show" & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; One class = "btn next" href = "javascript:;" Title = "Next" & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; One class = "btnToggle" href = "javascript :;" Title = "toggle shape" & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; An id = "btnTest" href = "javascript:;" Title = "test button" & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; One class = "btn close" href = "javascript:;" Title = "closed" & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; Edit: I have included a JSFDial - - The button I added to Belal is the last ... In this case, there is another toggle between toggles and close. I did not feel like adding images to my buttons right css.
Your bela has been updated here
afterShow: function ( Opts, obj) {$ ('# fancybox-buttons'). ("Click", "#btnTest", function (event) {event.preventDefault (); Warning ('test');}
Comments
Post a Comment