Hi everyone!
I started to study JQuery a week ago, so i'm still a beginner.
I have a difficulty: how to get access to JQuery buttons, which are located inside JQuery dialog? Here is the code of initializing the last one:
- function initDialog()
- {
- var enterLabel = "Log in";
- var closeLabel = "Close";
- var buttons = {};
- buttons[enterLabel] = function()
- {
- $("#check_logpass_text").slideDown(1000);
- //$("#Log in").fadeOut(1000);
- //problem string
- return 1;
- }
- buttons[closeLabel] = function()
- {
- closeDialog();
- }
- $("#win_login").dialog (
- {
- autoOpen: false,
- title: "System log in",
- position: ['center', 'center'],
- modal: true,
- resizable: false,
- width: '330',
- show: 'explode',
- hide: 'explode',
- buttons: buttons
- });
- }
- }
As you can see in string #12, i'm trying to reach "Log in" button inside the dialog form, but can't do it: the button, i guess, does not have any id or class, so i can't call it as above. My aim is to make the button dissapear after click on it. Method slideDown, situated a string above, works well: its' purpose is to show a part of text ("check_logpass_text" is a class).
I was also trying to call fadeOut like this:
- //$('buttons[enterLabel]').fadeOut(1000);
and like this:
- //$("#win_login").dialog ("option", "buttons").fadeOut (1000);
and even like this %)
but in first two cases it doesn't work at all, in the last one it hides the whole dialogs' document.
Thanks a lot for any help!