Reputation: 4898
Does anyone see why the $('' line breaks the jQuery below? There's a jsfiddle here: http://jsfiddle.net/8ZBRP/2/. If you comment out the $('div') line the code at least compiles and hits the debugger line when you right-click #box.
$(function() {
$('#box').contextmenu(function(e) {
e.preventDefault();
var document_offset;
debugger;
doc_offset = $(this).offset();
$('<div>').css({width:150px, height:150px});
});
});
Thanks
Upvotes: 0
Views: 73
Reputation: 15860
Shouldn't you be using this:
$('div').css({width:"150px", height:"150px"});
instead of:
$('<div>').css({width:150px, height:150px});
Or try to qoute the styles. However, I have not tried using the angle brackets but still try it.
Upvotes: -1
Reputation: 78650
$('<div>').css({width:"150px", height:"150px"});
unquoted strings.
Upvotes: 4