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
But this one don't work
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') });
});