Popup on Hover

Hi,

I am attaching a popUp to a toolbar button and want it to show on hover over the button rather than click. How to achieve this ?

Thanks,

Dave

Hi
There is no native approach, but you can try the next code snippet:

toolbarData = { parent: "toolbarObj", icon_path: "../dhtmlxSuite_v403_pro/samples/dhtmlxToolbar/common/imgs/", skin: 'dhx_skyblue', items: [{ type: "button", id: "open", img: "open.gif" }, { type: "button", id: "save_as", text: "Save As...", img: "save_as.gif" }, { type: "button", id: "cut", img: "cut.gif" }, { type: "button", id: "copy", img: "copy.gif" }, { type: "buttonTwoState", id: "paste", img: "paste.gif" }] }; toolbar = new dhtmlXToolbarObject(toolbarData); myPop = new dhtmlXPopup({ mode: "bottom"}); obj = toolbar.objPull[toolbar.idPrefix+"save_as"].obj; obj.onmouseover = function(){ myPop.attachHTML("Save project as..."); var x = getAbsoluteLeft(obj); var y = getAbsoluteTop(obj); var w = obj.offsetWidth; var h = obj.offsetHeight; myPop.show(x, y, w, h); } obj.onmouseout = function(){ myPop.hide(); }

Hi

How to archive this to a ribbon button same way ???

I create my ribbon like this , since it’s not attach to a parent it use the body has default.

[code] myRibbon = myLayout.attachRibbon({
icons_path: “common/”,
xml: “common/data.xml”

		});

[/code]

          obj = myRibbon.objPull[myRibbon.idPrefix+"newID"].obj;
            obj.onmouseover = function(){
             myPop.attachHTML("Save project as...");
             var x = getAbsoluteLeft(obj);
             var y = getAbsoluteTop(obj);
             var w = obj.offsetWidth;
             var h = obj.offsetHeight;
             myPop.show(x, y, w, h);
          }
          obj.onmouseout = function(){
             myPop.hide();
          }

I try it and wont work because it’s not an object ??

thanks

Hi

try myRibbon._items[id].base