1

I'm confused why the script below doesn't work... It appends the div (import_box) and makes it draggable, but not resizable? Am I missing something, I've tried a few different things but they all either disable the dragging or do nothing to improve the situation. I'd be happy for any help...

function open_import_window(){
$('body').append('<div id="msg_bg"></div>');
$('body').append('<div id="import_box" class="import_box"><div class="title_bar">Import</div><div id="content_import_box"></div></div>');
$('#import_box').draggable({handle:".title_bar"}).resizable();
var window_width = $(window).innerWidth();
var import_box_left = (window_width/2)-400;
$("#import_box").css("left", import_box_left);

var window_height = $(window).innerHeight();
var import_box_top = (window_height/2)-250;
$("#import_box").css("top", import_box_top);

$.ajax({
    url: 'import.php',
    success: function(data) {
        $('#content_import_box').html(data);
        resize();
    }
});
}

I made a small jsfiddle: http://jsfiddle.net/YSs6U/

Lennart
  • 1,560
  • 5
  • 20
  • 38

1 Answers1

5

Yes. you're missing the jQuery UI CSS. See this fiddle, check the 'Add Resources' button on the left for the link to (one) jQuery UI CSS theme.

Ohgodwhy
  • 49,779
  • 11
  • 80
  • 110
  • Stupid me :P, Thanks for clearing that up, I didn't realise that the css file would cause a problem like this. It works now. Thanks again :) – Lennart Aug 01 '12 at 14:04