Jquery ui tooltip custom class on page load

I use jQuery ui tooltip for my text fields, and I defined a custom class like this, and

.ui-tooltip1 {
    padding: 8px;
    position: absolute;
    z-index: 9999;
    max-width: 300px;
    -webkit-box-shadow: 0 0 5px #aaa;
    box-shadow: 0 0 5px #aaa;
    background-color:white !important; 
    color: Red !important;
}

I use it as follows:

         $(".phone").tooltip({
            tooltipClass: "ui-tooltip1"
        });

but this class does not apply when I load the page first. the load default page uses the prompt class. How can I apply this class to a hint when loading a page?

Please offer.

+5
source share
2 answers

Just use $(document).ready

$(document).ready(function() {
    $(".phone").tooltip({
        tooltipClass:"ui-tooltip1"
    });
});
+8
source

. :
jquery-ui tooltip ui tooltip having both ui-classes and your custom class.
SO: : " , , CSS. class .".

, , ui-css, css:

<link rel="stylesheet" href="../css/jquery_ui_1.10.1.css" type="text/css" />
<link rel="stylesheet" href="../css/myown.css" type="text/css" />
+8

All Articles