Skip to content

Commit ff7e7f1

Browse files
committed
setContent() with a jquery selector
Hello, I think there is a little mistake in case of using setContent() with a jquery selector as argument. It produce a javascript error: "Uncaught TypeError: Cannot read property 'appendTo' of null".
1 parent 44be69a commit ff7e7f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/jBox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ jBox.prototype.setContent = function(content, ignore_positioning) {
11041104
// Set the new content
11051105
switch (jQuery.type(content)) {
11061106
case 'string': this.content.html(content); break;
1107-
case 'object': this.content.children().css({display: 'none'}); this.options.content.appendTo(this.content).css({display: 'block'}); break;
1107+
case 'object': this.content.children().css({display: 'none'}); content.appendTo(this.content).css({display: 'block'}); break;
11081108
}
11091109

11101110
// Calculate the difference to before the content was set

0 commit comments

Comments
 (0)