简体   繁体   中英

How can i change the font-size of my button in my modal form dialog jquery

Here is my jqmodal form code:

$("#dialog-form").dialog({
    autoOpen: false,        //Shows dialog
    height: 300,
    width: 220,
    modal: true,
    fontSize: "100%",
    buttons: {
      "Save": function () {
        $(this).dialog('close');
          alert("Customer successfully added!");
           $.post('insertsup.php', $('#customer').serialize(), function(result){




}).css("font-size", "62.5%");   

        },
        "Cancel": function () 

        {
            $(this).dialog("close");
        }



    }

How can I edit my font-size to 62.5% in the jqmodal including the button text size? please help me..

Please -- stop flagging these questions as jqModal. You are using jquery ui dialog!

That said; use CSS to change the font-size. Not javascript. Please include your markup (aka HTML) that includes your button element and I can provide guidance on that.

As an example;

<button style="font-size: 62.5%;">button text</button>

several ways to fix this

$("#dialog-form").css({"font-size": "62.5%"}); This ensures that all text belonging to the div #dialog-form has font-size of 62.5%. Of course if you have another div inside it with custom font properties you'll never see this change reflected in those child divs.

Another thing I noticed is that you're appending .css to the end of you jquery ui dialog/modal. I think you're suppose to treat it with {} per Jquery documentation Jquery CSS API so the correct way would be .css({"font-size": "62.5%"});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM