Small tooltip problem with Floatbox 5.41

Page: 1

Author Post
Member
Registered: May 2009
Posts: 43
Hi,
i have a small tooltip problem. A tooltip graphics (54x54) are presented. These are in the new version too big. Can I also get small again.
Please go over the colored boxes.

Test page, here too big :-(
http://www.rainbow-gym.de/html\kursplan\1\kursplan5.41.htm

Original page with version 5.34. Here everything is OK :-)
http://www.rainbow-gym.de/html\kursplan\1\kursplan.htm

best regards

Sorry, translate with google
Administrator
Registered: Aug 2008
Posts: 3382
This is the minContentWidth and minContentHeight settings taking effect. The defaults for those are 140 and 100 px. Perhaps Floatbox should apply these options only to standard floatboxes and not to tooltips. I'll review that.

My recommendation is that you set minContentWidth:50 and minContentHeight:50 either in the 'globalOptions' section or the 'tooltip' section of options.js.
Member
Registered: May 2009
Posts: 43
hi,
worked great, have added the data in the options.js.
But I have a little problem detected. In the original page, the color changes when mouseover. In floatbox 5.41 not.
Here is the Sript to change color:

onmouseover="change_to1(this)" onmouseout="change_back1(this)"

function change_to1(element) {
element.style.border ='0 solid #000077';
element.style.backgroundColor ='#9C0F1D';
element.style.color ='#FFFFFF';
}
function change_back1(element) {
element.style.border ='0 solid red';
element.style.backgroundColor ='';
element.style.color ='#4E2D42';
}

You know why that is and can you give me a hint to the color change again.
Under 5.34 it is working correctly
Member
Registered: May 2009
Posts: 43
Also it does not work with CSS. I have both sides of the table - changed in CSS "Mo 10.00 - 11.00 Bodystyling Nancy - yellow, top, left". It only works under Floatbox 5.34, unfortunately not Floatbox 5.41.

Quellcode - line 235:
class=”normal”
onmouseover="this.className='hover'" onmouseout="this.className='normal'"

td.normal { Font-Family:Arial; Font-Size: 8pt; Font-Weight:Lighter; Color:#4E2D42; Line-Height:14px; background: #FFD600; }
td.hover { Font-Family:Arial; Font-Size: 8pt; Font-Weight:Lighter; Color:#ffffff; Line-Height:14px; background: #9C0F1D; }

Any idea :roll:
« Last edit by wnwtal on Thu Sep 27, 2012 8:07 pm. »
Member
Registered: Dec 2010
Posts: 39
Location: Madrid, Spain
I think this is what Byron is going to tell you:
Quote
As of 5.4.0 the tooltip mouse events have started using DOM0 events such as 'onmouseover', of which there can be only one handler per event. Previously DOM2 events were used such as 'mouseover', which can co-exist with other handlers of the same event. The change was made in an effort to squelch all possible memory leaks in IE, and also to make the code less complex (and hence hopefully more reliable).

Your use of the mouseover events is not really legitimate. Javascript should be used for behaviour and css for appearance. Rather than swapping classes on mouse events, it would be more appropriate for you to assign :hover styles, such as a:hover img { ... } to style those thumbnails. This is clean and reliable in all browsers.
Administrator
Registered: Aug 2008
Posts: 3382
Well put. I couldn't have said it better myself. Although in general (with one notable current exception) I prefer to refrain from commenting on the correctness or 'legitimacy' of someone's approach to their own web site here on the public forum.

In case it's not clear, the tooltip activation replaces the existing onmouseover handler with it's own.

Reality is, people use javascript mouseover handlers to change appearance and Floatbox strives to work as well as it can in the real world and to break as little as possible when being upgraded. I'll review going back to DOM2 events for tooltips in the next release but it's not a certainty that I will revert.

Currently, I think moving the styling to the :hover pseudo-class is the quickest and 'correctest' fix. Another approach would be to put the tooltip on a different nested element (parent or child) than the one that hosts the styling onmouseover handler.
Member
Registered: May 2009
Posts: 43
hi,
thanks for your help, I'll let the thing go again through the head.
wish you have a nice time

Page: 1