Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.8] MyBB FancyBox v1.1.2
#10
(2018-08-07, 10:18 AM)Wildcard Wrote: @8guawong Better to do code suggestions on GitHub Wink

i don't really know how to use github Sad

(2018-08-07, 11:50 AM)Eldenroot Wrote: I will review your code and maybe add it into next version. If anybody has any suggestion or a question let me know.

Anyway your code affects only images added into post via attachment, NOT all images added via img button in editor.

Quote:after doing the following you'll be able to open all images in 1 post with fancybox gallery
change the headerinclude lines in first post to
<link rel="stylesheet" href="/fancybox/jquery.fancybox.min.css" type="text/css" media="screen" />
<script type="text/javascript" src="/fancybox/jquery.fancybox.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $('.post_body img').each(function() {
        var currentImage = $(this);
        var pid = currentImage.parents('.post_body.scaleimages').attr('id');
        if (currentImage.hasClass('smilie') == false && currentImage.parent().is('a') == false) {
            currentImage.wrap("<a target='_blank' data-fancybox='" + pid + "' data-type='image' href='" + currentImage.attr("src") + "'</a>");
        }
    });
});
</script>

so in mybbfancybox.js change

$(document).ready(function() {

	$('.post_body img').each(function() {
		var currentImage = $(this);
		if (currentImage.hasClass('smilie') == false && currentImage.parent().is('a') == false) {
			currentImage.wrap("<a title='Click to enlarge' target='_blank' data-fancybox data-type='image' href='" + currentImage.attr("src") + "'>");
		}
  });

to

$(document).ready(function() {
    $('.post_body img').each(function() {
        var currentImage = $(this);
        var pid = currentImage.parents('.post_body.scaleimages').attr('id');
        if (currentImage.hasClass('smilie') == false && currentImage.parent().is('a') == false) {
            currentImage.wrap("<a title='Click to enlarge' target='_blank' data-fancybox='" + pid + "' data-type='image' href='" + currentImage.attr("src")  + "'>");
        }
    });
});
Reply


Messages In This Thread
MyBB FancyBox v1.1.2 - by Eldenroot - 2018-08-06, 07:01 PM
RE: MyBB FancyBox - by Wildcard - 2018-08-07, 01:02 AM
RE: MyBB FancyBox - by 8guawong - 2018-08-07, 01:57 AM
RE: MyBB FancyBox - by Eldenroot - 2018-08-07, 05:15 AM
RE: MyBB FancyBox - by 8guawong - 2018-08-07, 06:49 AM
RE: MyBB FancyBox - by Eldenroot - 2018-08-07, 08:29 AM
RE: MyBB FancyBox - by 8guawong - 2018-08-07, 09:27 AM
RE: MyBB FancyBox - by Wildcard - 2018-08-07, 10:18 AM
RE: MyBB FancyBox - by Eldenroot - 2018-08-07, 11:50 AM
RE: MyBB FancyBox - by 8guawong - 2018-08-07, 12:32 PM
RE: MyBB FancyBox - by Eldenroot - 2018-08-07, 03:51 PM
RE: MyBB FancyBox - by Wildcard - 2018-08-07, 03:59 PM
RE: MyBB FancyBox - by 8guawong - 2018-08-07, 04:15 PM
RE: MyBB FancyBox - by Eldenroot - 2018-08-07, 04:47 PM
RE: MyBB FancyBox - by 8guawong - 2018-08-07, 05:16 PM
RE: MyBB FancyBox - by Eldenroot - 2018-08-07, 05:53 PM
RE: MyBB FancyBox - by 8guawong - 2018-08-07, 06:01 PM
RE: MyBB FancyBox - by Eldenroot - 2018-08-07, 06:39 PM
RE: MyBB FancyBox - by 8guawong - 2018-08-07, 06:45 PM
RE: MyBB FancyBox - by Serpius - 2018-08-07, 07:02 PM
RE: MyBB FancyBox - by Eldenroot - 2018-08-07, 07:21 PM
RE: MyBB FancyBox v0.4 - by 8guawong - 2018-08-07, 11:22 PM
RE: MyBB FancyBox v0.5 - by Eldenroot - 2018-08-30, 04:22 PM
RE: MyBB FancyBox v0.5 - by Wildcard - 2018-08-30, 09:43 PM
RE: MyBB FancyBox v0.5 - by Eldenroot - 2018-09-05, 06:06 PM
RE: MyBB FancyBox v0.6 - by schauan - 2018-09-21, 04:28 PM
RE: MyBB FancyBox v0.6 - by Eldenroot - 2018-09-21, 06:46 PM
RE: MyBB FancyBox v0.6 - by Wildcard - 2018-09-21, 08:27 PM
RE: MyBB FancyBox v0.6 - by Eldenroot - 2018-09-21, 08:32 PM
RE: MyBB FancyBox v0.7 - by schauan - 2018-09-22, 05:46 PM
RE: MyBB FancyBox v0.7 - by Eldenroot - 2018-09-23, 11:09 AM
RE: MyBB FancyBox v0.7 - by schauan - 2018-09-28, 08:13 AM
RE: MyBB FancyBox v0.7 - by Eldenroot - 2018-09-28, 08:21 AM
RE: MyBB FancyBox v0.7 - by schauan - 2018-09-28, 02:22 PM
RE: MyBB FancyBox v0.7 - by 8guawong - 2018-09-28, 03:01 PM
RE: MyBB FancyBox v0.7 - by Eldenroot - 2018-09-28, 03:56 PM
RE: MyBB FancyBox v0.7 - by schauan - 2018-09-29, 06:05 PM
RE: MyBB FancyBox v0.7 - by Eldenroot - 2018-09-29, 06:07 PM
RE: MyBB FancyBox v0.8 - by iAndrew - 2018-10-29, 05:32 PM
RE: MyBB FancyBox v0.8 - by Eldenroot - 2018-10-29, 05:57 PM
RE: MyBB FancyBox v0.8 - by iAndrew - 2018-10-31, 03:52 PM
RE: MyBB FancyBox v0.8.2 - by Eldenroot - 2018-12-10, 08:17 PM
RE: MyBB FancyBox v0.8.2 - by Eldenroot - 2019-06-17, 05:46 PM
RE: MyBB FancyBox v0.8.2 - by NotAdmin - 2019-06-17, 05:51 PM
RE: MyBB FancyBox v0.8.2 - by Eldenroot - 2019-06-17, 05:54 PM
RE: MyBB FancyBox v0.8.2 - by Boogie® - 2019-06-19, 11:04 AM
RE: MyBB FancyBox v0.8.2 - by Eldenroot - 2019-06-19, 01:03 PM
RE: MyBB FancyBox v0.8.2 - by Boogie® - 2019-06-19, 02:51 PM
RE: MyBB FancyBox v0.8.2 - by NotAdmin - 2019-06-23, 07:13 PM
RE: MyBB FancyBox v0.8.2 - by Eldenroot - 2019-06-23, 07:14 PM
RE: MyBB FancyBox v0.8.2 - by NotAdmin - 2019-06-23, 07:19 PM
RE: MyBB FancyBox v0.8.2 - by Eldenroot - 2019-06-23, 07:21 PM
RE: MyBB FancyBox v0.8.2 - by NotAdmin - 2019-06-23, 09:34 PM
RE: MyBB FancyBox v0.8.2 - by Eldenroot - 2019-06-24, 04:03 PM
RE: MyBB FancyBox v1.0.0 - by Eldenroot - 2019-06-30, 02:35 PM
RE: MyBB FancyBox v1.0.0 - by iAndrew - 2019-06-30, 04:54 PM
RE: MyBB FancyBox v1.0.0 - by Eldenroot - 2019-06-30, 06:24 PM
RE: MyBB FancyBox v1.0.0 - by iKsu - 2019-06-30, 07:16 PM
RE: MyBB FancyBox v1.0.0 - by Eldenroot - 2019-06-30, 07:17 PM
RE: MyBB FancyBox v1.0.0 - by iKsu - 2019-06-30, 10:31 PM
RE: MyBB FancyBox v1.0.0 - by Eldenroot - 2019-07-01, 04:31 AM
RE: MyBB FancyBox v1.0.0 - by iKsu - 2019-07-01, 04:48 AM
RE: MyBB FancyBox v1.0.0 - by Eldenroot - 2019-07-01, 08:12 PM
RE: MyBB FancyBox v1.0.0 - by iKsu - 2019-07-01, 08:51 PM
RE: MyBB FancyBox v1.0.0 - by Eldenroot - 2019-07-01, 08:53 PM
RE: MyBB FancyBox v1.0.0 - by iKsu - 2019-07-01, 09:01 PM
RE: MyBB FancyBox v1.0.0 - by Eldenroot - 2019-07-02, 06:29 AM
RE: MyBB FancyBox v1.0.0 - by iKsu - 2019-07-02, 07:33 AM
RE: MyBB FancyBox v1.0.0 - by l3n0x - 2019-09-22, 07:42 PM
RE: MyBB FancyBox v1.0.0 - by liontaris - 2019-09-23, 07:44 PM
RE: MyBB FancyBox v1.0.0 - by Eldenroot - 2019-09-25, 08:13 AM
RE: MyBB FancyBox v1.0.0 - by sappy - 2019-10-18, 07:00 PM
RE: MyBB FancyBox v1.0.0 - by Eldenroot - 2019-10-29, 07:52 PM
RE: MyBB FancyBox v1.0.1 - by schauan - 2020-01-04, 08:55 AM
RE: MyBB FancyBox v1.0.1 - by Eldenroot - 2020-01-04, 12:37 PM
RE: MyBB FancyBox v1.0.1 - by schauan - 2020-01-19, 12:23 PM
RE: MyBB FancyBox v1.0.1 - by Eldenroot - 2020-01-19, 04:04 PM
RE: MyBB FancyBox v1.0.1 - by schauan - 2020-01-19, 04:28 PM
RE: MyBB FancyBox v1.0.1 - by sappy - 2020-06-26, 08:59 AM
RE: MyBB FancyBox v1.1.0 - by Eldenroot - 2021-01-03, 08:44 PM
RE: MyBB FancyBox v1.1.1 - by Eldenroot - 2021-01-21, 08:45 PM
RE: MyBB FancyBox v1.1.1 - by Dr_The_One - 2021-02-04, 04:57 AM
RE: MyBB FancyBox v1.1.1 - by Laird - 2021-02-04, 08:44 AM
RE: MyBB FancyBox v1.1.1 - by Eldenroot - 2021-02-04, 08:56 AM
RE: MyBB FancyBox v1.1.1 - by Dr_The_One - 2021-02-04, 05:42 PM
RE: MyBB FancyBox v1.1.2 - by Eldenroot - 2021-04-04, 09:14 AM
RE: MyBB FancyBox v1.1.2 - by RealSelf - 2021-04-16, 03:03 PM
RE: MyBB FancyBox v1.1.2 - by OakleY - 2021-05-23, 09:17 PM
RE: MyBB FancyBox v1.1.2 - by Eldenroot - 2021-05-24, 01:15 PM
RE: MyBB FancyBox v1.1.2 - by infosmart - 2021-06-15, 08:10 PM
RE: MyBB FancyBox v1.1.2 - by timelord - 2021-09-09, 07:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)