2 Replies - 1168 Views - Last Post: 10 April 2012 - 03:21 AM

#1 Duckington   User is offline

  • D.I.C Addict

Reputation: 172
  • View blog
  • Posts: 615
  • Joined: 12-October 09

dialog box

Posted 03 April 2012 - 01:46 PM

HI,

I have this dialog box:

$(function(){
    // Dialog			
    $('#popUp').dialog({
            autoOpen: false,
            width: 600,
            height: 200,
            buttons: {
                    "Share": function() { 
                            sharePopUpContent( $('#popUpContent').html() );
                            $(this).dialog("close");
                    },
                    "Close": function() { 
                            $(this).dialog("close"); 
                    }
            }
    });
});



And when it pops up, the first button "Share" is automatically given the class "ui-state-focus" before you have hovered or clicked on it. Is there a way to alter this? As I don't want it to have the focus class until it is actually focused upon.

Thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: dialog box

#2 X-spert   User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 56
  • Joined: 25-August 11

Re: dialog box

Posted 09 April 2012 - 08:45 AM

View PostDuckington, on 03 April 2012 - 01:46 PM, said:

HI,

I have this dialog box:

$(function(){
    // Dialog			
    $('#popUp').dialog({
            autoOpen: false,
            width: 600,
            height: 200,
            buttons: {
                    "Share": function() { 
                            sharePopUpContent( $('#popUpContent').html() );
                            $(this).dialog("close");
                    },
                    "Close": function() { 
                            $(this).dialog("close"); 
                    }
            }
    });
});



And when it pops up, the first button "Share" is automatically given the class "ui-state-focus" before you have hovered or clicked on it. Is there a way to alter this? As I don't want it to have the focus class until it is actually focused upon.

Thanks.


Hi,

Try something like this (in your dialog function):
open: function() {
    $('.ui-button').removeClass('ui-state-focus');
}


Was This Post Helpful? 1
  • +
  • -

#3 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6260
  • View blog
  • Posts: 24,030
  • Joined: 23-August 08

Re: dialog box

Posted 10 April 2012 - 03:21 AM

You could use blur in your trigger to open the dialog.

$('.ui-dialog :button').blur();

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1