Problem with initial position of tooltip inside exposed form, second time triggering OK
Posted: Mar 14, 2010
I've created form with "expose" behavior,
for element <input ... > I would like show tooltip.
The problem is follow:
After refreshing my page:
http://en.tmf.rtu.lv/test/expo.php
The tooltip is not on its place, but after second time clicking on <input .... > the tooltip is showing in the designed place.
$(document).ready(function(){ :
HTML - form:
for element <input ... > I would like show tooltip.
The problem is follow:
After refreshing my page:
http://en.tmf.rtu.lv/test/expo.php
The tooltip is not on its place, but after second time clicking on <input .... > the tooltip is showing in the designed place.
$(document).ready(function(){ :
$.tools.tooltip.conf.relative= "true";
$("form.expose").css(
{
'background-color': '#fff',
'border': '1px solid #fff'
}
);
$("#frm :input").tooltip({
events: {
def: 'focus, focusout',
input: 'click , blur',
tooltip: "mouseover",
date: 'click, blur'
},
effect: 'fade',
relative: "true",
offset: [ -20, 0],
position: "top center",
opacity: 0.7,
tip: '.tooltip'
});
// expose the form when it's clicked or cursor is focused
$("form.expose").bind("click keydown", function() {
$(this).expose({
color: '#150000',
opacity: '0.92',
// when exposing is done, change form's background color
onLoad: function() {
this.getExposed().css(
{
'background-color': '#fff',
'border': '1px outset #140000'
}
);
},
// when "unexposed", return to original background color
onClose: function() {
$("div.tooltip").hide(),
this.getExposed().css(
{
'background-color': '#fff',
'border': '1px solid #fff'
}
);
},
api: true
}).load();
});
HTML - form:
<form class="expose" autocomplete="off" id="frm" name="frm" action="#" method="post">
<br><br><br><br><br><br><br><br>
<div id="inputs">
<div class="tooltip">eeeeeeee</div>
<input id="username" name="username" class="request" value="click here" type="text">
<br><br><br><br><br><br><br><br>
</form>
