bind a jquery function to fancybox .close() event

*Update: * Please take a note of @mathoiland’s answer, “It looks like Fancybox 2 deprecated the onClosed callback. It now uses afterClose.” if you are using FancyBox 2.x Pass the onClosed option to the fancybox function. i.e: $(“<YOUR-SELECTOR>”).fancybox({ onClosed: function() { $(‘#sub_cont’).hide(250, function() { $(‘#IDsearchform input’).val(”); }); }) });

Open fancybox from function

If you’d like to simply open a fancybox when a javascript function is called. Perhaps in your code flow and not as a result of a click. Here’s how you do it: function openFancybox() { $.fancybox({ ‘autoScale’: true, ‘transitionIn’: ‘elastic’, ‘transitionOut’: ‘elastic’, ‘speedIn’: 500, ‘speedOut’: 300, ‘autoDimensions’: true, ‘centerOnScroll’: true, ‘href’ : ‘#contentdiv’ }); } … Read more

Open YouTube video in Fancybox jQuery

THIS IS BROKEN, SEE EDIT <script type=”text/javascript”> $(“a.more”).fancybox({ ‘titleShow’ : false, ‘transitionIn’ : ‘elastic’, ‘transitionOut’ : ‘elastic’, ‘href’ : this.href.replace(new RegExp(“watch\\?v=”, “i”), ‘v/’), ‘type’ : ‘swf’, ‘swf’ : {‘wmode’:’transparent’,’allowfullscreen’:’true’} }); </script> This way if the user javascript is enabled it opens a fancybox with the youtube embed video, if javascript is disabled it opens the … Read more

Require statement in application.css.scss

application.css.scss or application.css are kinda the same. Just rename your application.css to application.css.scss. As for adding that line, it’ll need to be right up the top, in a comment. Like this: /* * This is a manifest file that’ll be compiled into application.css, which will include all the files * listed below. * * Any … Read more

jquery fancybox 2.0.3 – prevent close on click outside of fancybox

Use this option: helpers : { overlay : {closeClick: false} } so your final script should look like: $(document).ready(function() { $(“.various”).fancybox({ closeClick : false, // prevents closing when clicking INSIDE fancybox openEffect : ‘none’, closeEffect : ‘none’, helpers : { overlay : {closeClick: false} // prevents closing when clicking OUTSIDE fancybox } }).trigger(“click”); }); hideOnOverlayClick … Read more

Proper way to use JQuery when using MasterPages in ASP.NET?

You would declare your main jQuery scripts within the master page, as you would normally: <head runat=”server”> <link href=”https://stackoverflow.com/Content/Interlude.css” rel=”Stylesheet” type=”text/css” /> <script type=”text/javascript” src=”/Scripts/jquery-1.3.2.min.js”></script> <asp:ContentPlaceHolder ID=”head” runat=”server”> </asp:ContentPlaceHolder> </head> And then any page specific JS files could be loaded within the Content controls that reference the Head ContentPlaceholder. However, a better option would be … Read more

techhipbettruvabetnorabahisbahis forumueduseduseduseduedueduedusedueduedus