Like SystemiConnectFri 15 Oct 2021, 04:50
Auto Save MessagesLGforumFri 26 Feb 2021, 13:31
New tutorial questionTheCrowMon 15 Feb 2021, 08:12
Support iOS Emojis (and other platforms)LGforumSun 14 Feb 2021, 01:25
LGforum (2806)
can some one help me fix the code so they both work with each other ? Vote_lcapcan some one help me fix the code so they both work with each other ? Voting_barcan some one help me fix the code so they both work with each other ? Vote_rcap 
Mr.Easybb (1587)
can some one help me fix the code so they both work with each other ? Vote_lcapcan some one help me fix the code so they both work with each other ? Voting_barcan some one help me fix the code so they both work with each other ? Vote_rcap 
Bloodbath (745)
can some one help me fix the code so they both work with each other ? Vote_lcapcan some one help me fix the code so they both work with each other ? Voting_barcan some one help me fix the code so they both work with each other ? Vote_rcap 
Rukiafan (533)
can some one help me fix the code so they both work with each other ? Vote_lcapcan some one help me fix the code so they both work with each other ? Voting_barcan some one help me fix the code so they both work with each other ? Vote_rcap 
Dom (513)
can some one help me fix the code so they both work with each other ? Vote_lcapcan some one help me fix the code so they both work with each other ? Voting_barcan some one help me fix the code so they both work with each other ? Vote_rcap 
puppycheese (446)
can some one help me fix the code so they both work with each other ? Vote_lcapcan some one help me fix the code so they both work with each other ? Voting_barcan some one help me fix the code so they both work with each other ? Vote_rcap 
pedro (330)
can some one help me fix the code so they both work with each other ? Vote_lcapcan some one help me fix the code so they both work with each other ? Voting_barcan some one help me fix the code so they both work with each other ? Vote_rcap 
Neymar (301)
can some one help me fix the code so they both work with each other ? Vote_lcapcan some one help me fix the code so they both work with each other ? Voting_barcan some one help me fix the code so they both work with each other ? Vote_rcap 
Hitsu (281)
can some one help me fix the code so they both work with each other ? Vote_lcapcan some one help me fix the code so they both work with each other ? Voting_barcan some one help me fix the code so they both work with each other ? Vote_rcap 
Flora (275)
can some one help me fix the code so they both work with each other ? Vote_lcapcan some one help me fix the code so they both work with each other ? Voting_barcan some one help me fix the code so they both work with each other ? Vote_rcap 


can some one help me fix the code so they both work with each other ?

ApeApe
Status : loving the new site :)

Posts : 124
Join date : 2012-02-23
Location : UK
Thu 17 Jul 2014, 14:00
Hi all can some one tell me why this code is not working
I am trying to get it to work but it don't run
what am i missing

This button works


Code:
$(window).load(function() {
    var settings = {
        image : 'http://lemon-13.com/mu.jpg', // button image
        upload : 'http://lemon-13.com/m%20up/index.html', // iframe upload url
        height : '400px', // iframe height
        width : '600px' // iframe width
    };
 
    $('.sceditor-button-servimg').after('<a class="sceditor-button sceditor-button-pb"><div style="background-image:url(' + settings.image + ')"></div></a>');
    $('body').append('<div id="pb_container" class="sceditor-dropdown" style="display:none;"></div>');
 
    $('.sceditor-button-pb').click(function() {
        var X = $('.sceditor-button-pb').offset().left;
        var Y = $('.sceditor-button-pb').offset().top + 25;
     
        if (!document.getElementById('pb_frame') && $('#pb_container').css('display') == 'none') $('#pb_container').show().css('left',X + 'px').css('top',Y + 'px').append('<iframe id="pb_frame" style="border:none;height:' + settings.height + ';width:' + settings.width + ';" src="' + settings.upload + '"></iframe>');
        else if ($('#pb_container').css('display') == 'none') $('#pb_container').show().css('left',X + 'px').css('top',Y + 'px');
        else $('#pb_container').hide();
    });
 
    $('.sceditor-button:not(.sceditor-button-pb), .sceditor-container textarea, .sceditor-container iframe').click(function() { $('#pb_container').hide() });
    $('.sceditor-container iframe').contents().mousedown(function() { $('#pb_container').hide() });
    $('.sceditor-button-source').click(function() { $('.sceditor-button-pb').removeClass('disabled') });
});


But this one don't work

Code:
  $(window).load(function() {
        var settings = {
            image : 'http://lemon-13.com/up.png', // button image
            upload : 'http://lemon-13.com/upload-Center', // iframe upload url
            height : '250px', // iframe height
            width : '500px' // iframe width
        };
     
        $('.sceditor-button-servimg').after('<a class="sceditor-button sceditor-button-pb"><div style="background-image:url(' + settings.image + ')"></div></a>');
        $('body').append('<div id="pb_container" class="sceditor-dropdown" style="display:none;"></div>');
     
        $('.sceditor-button-pb').click(function() {
            var X = $('.sceditor-button-pb').offset().left;
            var Y = $('.sceditor-button-pb').offset().top + 25;
         
            if (!document.getElementById('pb_frame') && $('#pb_container').css('display') == 'none') $('#pb_container').show().css('left',X + 'px').css('top',Y + 'px').append('<iframe id="pb_frame" style="border:none;height:' + settings.height + ';width:' + settings.width + ';" src="' + settings.upload + '"></iframe>');
            else if ($('#pb_container').css('display') == 'none') $('#pb_container').show().css('left',X + 'px').css('top',Y + 'px');
            else $('#pb_container').hide();
        });
     
        $('.sceditor-button:not(.sceditor-button-pb), .sceditor-container textarea, .sceditor-container iframe').click(function() { $('#pb_container').hide() });
        $('.sceditor-container iframe').contents().mousedown(function() { $('#pb_container').hide() });
        $('.sceditor-button-source').click(function() { $('.sceditor-button-pb').removeClass('disabled') });
    });
Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Thu 17 Jul 2014, 17:36
Why not just use the awe plugin?

Code:
[panda=js]var editor = awe({//preset options});
  editor.add('pb',{
    tooltip:"Your tooltip",
    image:"http://lemon-13.com/up.png",
    defaultAttr:"whatever you want",
    group:"new",
    tag:"" //add tag if different than [ pb ]
  });

If this seems like a good option for you, I am starting to update again to add a dropdown section like before, I just forgot about it for the AWE 3.4
ApeApe
Status : loving the new site :)

Posts : 124
Join date : 2012-02-23
Location : UK
Thu 17 Jul 2014, 17:48
This is for some one i was helping and he don't have this installed on he's forum i don't think he even has LGBB on there
This is why it was done like the one i added
Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Thu 17 Jul 2014, 18:03
Oh well if he has FM, give him the code and use that. It's more efficient really, and you don't need LGBB, but anyways if this isn't a question I'll look further into your code, also if you could write what errors come up in the console. CTRL+SHIFT+J
ApeApe
Status : loving the new site :)

Posts : 124
Join date : 2012-02-23
Location : UK
Thu 17 Jul 2014, 21:45
This is what i get can some one help me fix the code so they both work with each other ? Untitl12
Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Thu 17 Jul 2014, 21:55
Well those are not errors, the grey blocks are logging, blue is for CSS, and black is network gets/post. So it means there is nothing actually happening within your code. You never add an event listener for [ic] sceditor-button-pb[/ic] either so.
ApeApe
Status : loving the new site :)

Posts : 124
Join date : 2012-02-23
Location : UK
Fri 18 Jul 2014, 11:12
So why is it when i click on one of the buttons it works but the other one don't ? im a little lost as you can see the buttons come up but they both don't work only one of them.
can some one help me fix the code so they both work with each other ? Untitl13
This one is the music note one when pressed as you can see it works
can some one help me fix the code so they both work with each other ? Captur20
Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Fri 18 Jul 2014, 18:56
Oh you did add the click function - but the two codes you posted I'm not seeing a difference in either one.
ApeApe
Status : loving the new site :)

Posts : 124
Join date : 2012-02-23
Location : UK
Mon 28 Jul 2014, 13:32
its ok it was the ID on the codes lol sorry to be a pain in the BUT lol Solved Wink
avatarMichael_vx
Status : No status yet...

Posts : 27
Join date : 2014-04-03
Wed 29 Oct 2014, 06:30
thanks wont be enough i was looking for that code for a long long time
i made the change and added my own image server thanks again

Code:
[panda=js]$(window).load(function() {
                var settings = {
                    image : 'http://micsoft.xp3.biz/theme/default/images/filebg.gif', // button image
                    upload : 'http://micsoft.xp3.biz/index.php', // iframe upload url
                    height : '250px', // iframe height
                    width : '500px' // iframe width
                };
             
                $('.sceditor-button-servimg').after('<a class="sceditor-button sceditor-button-pb"><div style="background-image:url(' + settings.image + ')"></div></a>');
                $('body').append('<div id="pb_container" class="sceditor-dropdown" style="display:none;"></div>');
             
                $('.sceditor-button-pb').click(function() {
                    var X = $('.sceditor-button-pb').offset().left;
                    var Y = $('.sceditor-button-pb').offset().top + 25;
                 
                    if (!document.getElementById('pb_frame') && $('#pb_container').css('display') == 'none') $('#pb_container').show().css('left',X + 'px').css('top',Y + 'px').append('<iframe id="pb_frame" style="border:none;height:' + settings.height + ';width:' + settings.width + ';" src="' + settings.upload + '"></iframe>');
                    else if ($('#pb_container').css('display') == 'none') $('#pb_container').show().css('left',X + 'px').css('top',Y + 'px');
                    else $('#pb_container').hide();
                });
             
                $('.sceditor-button:not(.sceditor-button-pb), .sceditor-container textarea, .sceditor-container iframe').click(function() { $('#pb_container').hide() });
                $('.sceditor-container iframe').contents().mousedown(function() { $('#pb_container').hide() });
                $('.sceditor-button-source').click(function() { $('.sceditor-button-pb').removeClass('disabled') });
            });
avatarGuest
Thu 05 May 2016, 05:50
Solved and archived.
Sponsored content