Hi people,

I'm trying to add dialog on one of my contents. Here is my code:

$(document).ready(function(){
$("#dialog").dialog();

});

Offcourse I have div named 'dialog' in the content where I wont dialog to appear.

I added js file (with this code) by adding "scripts[] = js/myjs.js" to .info file of my theme. Here I have many js functions. However thisone with the dialog wont work - error $("#dialog").dialog is not a function. I have installed jQuery UI module as well as jQuery Update module.

Should I install anything else?

Comments

markosaurus’s picture

Did you sort this?

It doesn't look like you need to install anything else.

What html are you using?

lepoja’s picture

When I put this JavaScript code in blank htnml page (off course I include jquery javascript in header) everything works fine. But when I type it in drupal content (story, page, etc) it wont work. I tought that it has something to do with jQuery Update module not working fine - so I switched it off. But nothing changes simeple jQuery doesn't work on my site.

Thanks for reply

sovarn’s picture

Does any Javascript work on the page?

markosaurus’s picture

Some modules also use jQuery, it may be that something is conflicting?

pol’s picture

Same problem too.

pol’s picture

Solved by adding jquery_ui_add("ui.dialog"); to template.php.

mikedotexe’s picture

I'm sure this is massively newb, but my whole dialog is transparent. How do I gain access to setting the background colors and all that? I thought that jQuery had a default theme, but that doesn't seem to be showing up.

Hakuna Matata

bloke_zero’s picture

Try?

  $jquery_ui_path = jquery_ui_get_path();
  drupal_add_css($jquery_ui_path . '/themes/base/jquery-ui.css');