Link should open fancybox ($.fancybox.pos) with the help of the click function
Date : March 29 2020, 07:55 AM
hope this fix your issue The pos function never worked. So I took the idea of a deleted answer to use the click-function. If a user clicks on my link it should simulate the click on the picture in the gallery. <script type="text/javascript">
var currentImage = 0;
function getCurrImage(carousel, state){
currentImage = carousel.first-1;
}
/*jQuery.noConflict();*/
jQuery(document).ready(function() {
jQuery('#fancycarousel').jcarousel({
scroll:1,
'itemLoadCallback': getCurrImage
});
jQuery('a[rel=example_group]').fancybox({
'transitionIn': 'none',
'transitionOut': 'none'
});
jQuery('#enlarge').click(function(){
jQuery(".jcarousel-item").eq(currentImage).children("a").click();
});
});
</script>
|
FancyBox how can I close active fancybox when link is clicked and open another fancybox?
Date : March 29 2020, 07:55 AM
|
FancyBox iFrame - Link in iFrame to close FancyBox and open in original parent page
Date : March 29 2020, 07:55 AM
hope this fix your issue What you can do is to set an onclick attribute on each link of the iframed page (remote.php) that calls a function in the parent page and passes their href as parameter. You could do this on-the-fly within the fancybox afterShow callback, so no need to hard-code the attribute in the iframed page. // this function gets the href of the clicked link in the iframed page
// then closes fancybox
// then reloads the current page with the new href
function closeFancybox(href){
jQuery.fancybox.close();
window.location.href = href;
}
jQuery(document).ready(function ($) {
$(".fancybox").fancybox({
afterShow : function () {
// set the onclick attribute on each link of the iframed page
// then passes the corresponding href to the parent page function
$(".fancybox-iframe").contents().find("a").attr("onclick", "parent.closeFancybox(this.href)");
},
// other API options
})
}); // ready
jQuery(document).ready(function ($) {
$(".fancybox").fancybox({
afterShow : function () {
// bind a click event on each link of the iframed page
// then call the closeFancybox and pass the corresponding href
$(".fancybox-iframe").contents().find("a").on("click", function () {
closeFancybox(this.href);
});
}
})
}); // ready
|
Fancybox: link that changes the url in address bar and links to a page with an open Fancybox
Date : March 29 2020, 07:55 AM
|
open fancybox over another fancybox ajax
Date : March 29 2020, 07:55 AM
|