Latest topics
» Web Page Speed & Optimization for FAE
by dannig Today at 08:39

» Bootstrap compatibility
by dannig Yesterday at 18:26

» Need Help installing Forumactif Edge Theme
by dannig Yesterday at 12:21

» Forumactif Edge - FRENCH Translation
by Milouze14 Yesterday at 12:05

» Awards
by Ange Tuteur Yesterday at 11:28

» [GAME] Count to One Million!
by Ange Tuteur Yesterday at 11:20

» Forumotion Edge - italian translation
by Ange Tuteur Yesterday at 11:10

» Forumactif Edge Web Page - Italian Translation
by Ange Tuteur Yesterday at 11:07

» [GAME] Post a random picture
by Ange Tuteur Yesterday at 11:02

» Hello!
by brandon_g Yesterday at 09:15

» Profile fields CSS/bbcode stopped working
by dannig Tue 25 Apr 2017, 11:21

» Issues with adjusting centered profile fields
by Ange Tuteur Mon 24 Apr 2017, 11:54

» [GAME] Q&A
by Dr Jay Sun 23 Apr 2017, 14:53

» [GAME] Last Letter Game
by Dr Jay Sun 23 Apr 2017, 14:26

» [GAME] Never have I ever..
by Dr Jay Sun 23 Apr 2017, 14:25

Recent Tutorials
Top posting users this month
Who is online?
In total there are 8 users online :: 1 Registered, 0 Hidden and 7 Guests

Bigtuber

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

Embed jQuery TwentyTwenty in the forum?

View previous topic View next topic Go down

avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Sun 25 Sep 2016, 07:33

How it could work on forumotion?
http://zurb.com/playground/twentytwenty

--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Wed 05 Oct 2016, 07:25

@Ange Tuteur Where are you?

--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Ace 1
Valued Member
Title :
God of Creation
Gender : Male
Age : 17
Posts : 2090
Points : 2666
Reputation : 75
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Wed 05 Oct 2016, 16:50

@Lorem I got you. You just want the double image thing right?

Just let me know where you want it at
avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Wed 05 Oct 2016, 20:21

@Ace 1 wrote:@Lorem I got you. You just want the double image thing right?

Just let me know where you want it at
Thank you Very Happy
I want it to appear in the post

--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Ace 1
Valued Member
Title :
God of Creation
Gender : Male
Age : 17
Posts : 2090
Points : 2666
Reputation : 75
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Thu 06 Oct 2016, 07:22

avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Thu 06 Oct 2016, 08:05

Yes, this is my forum and I want it to appear in the topic

--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Ace 1
Valued Member
Title :
God of Creation
Gender : Male
Age : 17
Posts : 2090
Points : 2666
Reputation : 75
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Fri 07 Oct 2016, 07:12

So how do you want people to enable it? By posting an image, selecting a SCEditor button?
avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Fri 07 Oct 2016, 07:19

@Ace 1 wrote:So how do you want people to enable it? By posting an image, selecting a SCEditor button?
Yes Huzzah

--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Ace 1
Valued Member
Title :
God of Creation
Gender : Male
Age : 17
Posts : 2090
Points : 2666
Reputation : 75
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Fri 07 Oct 2016, 20:12

Well, @Lorem this is all I could come up with. Since you have Invision, I don't know if this'll work. Let me know what you get.

TwentyTwenty Installation


Administration Panel > Display > Templates > General > viewtopic_body

Add this at the top:

Code:
<!-- CSS 2020 -->
<link type="text/css" rel="stylesheet" href="http://codepen.io/therealace_1/pen/rrJpav.css" />
<!-- jQuery Move Event -->
<script src="http://codepen.io/therealace_1/pen/yavpZj.js" type="text/javascript"></script>
<!-- jQuery 2020 -->
<script src="http://codepen.io/therealace_1/pen/LRQZGw.js" type="text/javascript"></script>


Creating the Javascripts


Administration Panel > Modules > HTML & Javascript > Javascript codes management > Create new javascript

Title: TwentyTwenty
Placement: In all the pages

Code:

Code:
$(function() {
  if ( /\/t\d+/.test(window.location.href) ) {
    $('.post [class*="content"]').each(function() {
        if ( $(this).find('.twentytwenty img').html() != undefined ) {
          $(this).find('.twentytwenty img').each(function() {
              if ( $(this).next().prop('tagName') == 'IMG' ) {
                  $(this).next().andSelf().wrapAll('<div class="2020"></div>');
              }
          });
          $('.2020').unwrap('td').unwrap('tr').unwrap('tbody').unwrap('table').twentytwenty();
        }
    });
  }

  if ( $.sceditor ) {
    $.sceditor.command.set('twentytwenty', {
        exec: function() {
            this.insert('[table class="twentytwenty"][tr][td][img]', '[/img][img]Image 2 Here[/img][/td][/tr][/table]');
        },
        txtExec: function() {
           
            this.insert('[table class="twentytwenty"][tr][td][img]', '[/img][img]Image 2 Here[/img][/td][/tr][/table]');
        },
        tooltip: '2020'
    });
    toolbar = toolbar.replace(/image/, 'image,twentytwenty');

    $('head').append(
        '<style type="text/css">' +
            '.sceditor-button-twentytwenty div {' +
                'background-size: cover;' +
                'background-image: url("https://i.imgsafe.org/823ece71a9.gif") !important;' +
            '}' +
        '</style>');
  }
});

I really hope this works. Let me know whatever you want fixed.
avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Fri 07 Oct 2016, 20:43

Wow!! It worked very well
You can view it here: http://www.forumgiaitri.net/t5883-so-sanh-anh-chup-tu-camera-cua-iphone-7-plus-va-galaxy-s7#9486

Thank you very much on this issue

--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Ace 1
Valued Member
Title :
God of Creation
Gender : Male
Age : 17
Posts : 2090
Points : 2666
Reputation : 75
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Fri 07 Oct 2016, 21:14

It worked

If there's any modifications you want, just let me knowww
avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Fri 07 Oct 2016, 21:28

I want a little change


--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Fri 07 Oct 2016, 21:34


--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Sun 09 Oct 2016, 20:32

@Ace 1 Can you help me?

--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Sun 09 Oct 2016, 23:14

oh really regret that it does not work

--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Ace 1
Valued Member
Title :
God of Creation
Gender : Male
Age : 17
Posts : 2090
Points : 2666
Reputation : 75
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Sun 09 Oct 2016, 23:23

Hold on @Lorem give me another day
avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Sun 09 Oct 2016, 23:25

@Ace 1 wrote:Hold on @Lorem give me another day
I can wait, no problem

--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Ace 1
Valued Member
Title :
God of Creation
Gender : Male
Age : 17
Posts : 2090
Points : 2666
Reputation : 75
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Tue 11 Oct 2016, 19:00

Sorry for the late reply..

@Lorem wrote:I want a little change


For this, just go to Display > Colors > CSS Stylesheet and add this:

Code:
.twentytwenty-before-label:before { content: 'Before'; }
.twentytwenty-after-label:before { content: 'After'; }

Change the
Code:
'Before'
and
Code:
'After'
to what you want.

@Lorem wrote:And it does not work here : http://www.forumgiaitri.net/tags/camera

@Ace 1

And for that, just replace my Javascript with this:

Code:
$(function() {
  if ( /\/t\d+/.test(window.location.href) || /\/tags/.test(window.location.href) ) {
    $('[class*="post"] [class*="content"]').each(function() {
        if ( $(this).find('.twentytwenty img').html() != undefined ) {
          $(this).find('.twentytwenty img').each(function() {
              if ( $(this).next().prop('tagName') == 'IMG' ) {
                  $(this).next().andSelf().wrapAll('<div class="2020"></div>');
              }
          });
          $('.2020').unwrap('td').unwrap('tr').unwrap('tbody').unwrap('table').twentytwenty();
        }
    });
  }

  if ( $.sceditor ) {
    $.sceditor.command.set('twentytwenty', {
        exec: function() {
            this.insert('[table class="twentytwenty"][tr][td][img]', '[/img][img]Image 2 Here[/img][/td][/tr][/table]');
        },
        txtExec: function() {
           
            this.insert('[table class="twentytwenty"][tr][td][img]', '[/img][img]Image 2 Here[/img][/td][/tr][/table]');
        },
        tooltip: '2020'
    });
    toolbar = toolbar.replace(/image/, 'image,twentytwenty');

    $('head').append(
        '<style type="text/css">' +
            '.sceditor-button-twentytwenty div {' +
                'background-size: cover;' +
                'background-image: url("https://i.imgsafe.org/823ece71a9.gif") !important;' +
            '}' +
        '</style>');
  }

  $('head').append(
      '<!-- CSS 2020 -->' +
      '<link type="text/css" rel="stylesheet" href="http://codepen.io/therealace_1/pen/rrJpav.css" />' +
      '<!-- jQuery Move Event -->' +
      '<script src="http://codepen.io/therealace_1/pen/yavpZj.js" type="text/javascript"></script>' +
      '<!-- jQuery 2020 -->' +
      '<script src="http://codepen.io/therealace_1/pen/LRQZGw.js" type="text/javascript"></script>'
  );
});

And you can actually remove the stuff I told you to place in your viewtopic_body template.


Last edited by Ace 1 on Wed 12 Oct 2016, 11:10; edited 1 time in total
avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Tue 11 Oct 2016, 20:29

@Ace 1 Thank you, but it still does not work

--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


avatar
Ace 1
Valued Member
Title :
God of Creation
Gender : Male
Age : 17
Posts : 2090
Points : 2666
Reputation : 75
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Wed 12 Oct 2016, 11:11

Oh @Lorem I had a small problem with my JavaScript. It's good now.
avatar
Lorem

Title :
Come from Vietnam
Gender : Male
Age : 18
Posts : 75
Points : 499
Reputation : 14
Location : Vietnam
Language : English, Vietnamese
Browser : Browser : Google Chrome Forum Version : Forum Version : Invision
Awards :
View all awards
View user profile http://www.forumgiaitri.net/ https://www.facebook.com/ForumGiaiTri https://twitter.com/forumgiaitri https://pinterest.com/forumgiaitri

PostLorem on Wed 12 Oct 2016, 11:26

@Ace 1 wrote:Oh @Lorem I had a small problem with my JavaScript. It's good now.
It not work again
maybe I'll use this way http://fmdesign.forumotion.com/t1048-embed-jquery-twentytwenty-in-the-forum#23022

--------

Leave this blue neighbourhood
Never knew loving could hurt this good

Troye Sivan ft. Alessia Cara


View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

 
Permissions in this forum:
You cannot reply to topics in this forum