CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   tooltip for wdCalendar (http://www.codingforums.com/showthread.php?t=284177)

dips255 12-15-2012 07:22 AM

tooltip for wdCalendar
 
Need help to convert the title that appears on the events area on mouseover to a nice looking tooltip. I tried to do this in BuildDayEvent function by adding p.class="masterTooltip" but it does not work.

Code:

function BuildDayEvent(theme, e, index) {
            var p = { bdcolor: theme[0], bgcolor2: theme[0], bgcolor1: theme[2], width: "70%", icon: "", title: "", data: "" };
                       
            p.starttime = pZero(e.st.hour) + ":" + pZero(e.st.minute);
            p.endtime = pZero(e.et.hour) + ":" + pZero(e.et.minute);
                                               
            p.content = e.event[1];
            p.title = getTitle(e.event);                       
                        //p.title = "onmouseover="showToolTip(event,'"+tooltip+"');return false" onmouseout="hideToolTip()"";
            p.data = e.event.join("$");
                       
            var icons = [];
            icons.push("<I class=\"cic cic-tmr\">&nbsp;</I>");
            if (e.reevent) {
                icons.push("<I class=\"cic cic-spcl\">&nbsp;</I>");
            }
            p.icon = icons.join("");
            var sP = gP(e.st.hour, e.st.minute);
            var eP = gP(e.et.hour, e.et.minute);
            p.top = sP + "px";
            p.left = (e.left * 100) + "%";
            p.width = (e.aQ * 100) + "%";
            p.height = (eP - sP - 4);
            p.i = index;
            if (option.enableDrag && e.event[8] == 1) {
                p.drag = "drag";
                p.redisplay = "block";
            }
            else {
                p.drag = "";
                p.redisplay = "none";
            }
            var newtemp = Tp(__SCOLLEVENTTEMP, p);
            p = null;
            return newtemp;
        }


<style>
.tooltip {
        display:none;
        position:absolute;
        border:1px solid #333;
        background-color:#161616;
        border-radius:5px;
        padding:10px;
        color:#fff;
        font-size:12px Arial;       
}

</style>
<script>
        $jtooltip = jQuery.noConflict();
        //$jtooltip("#gridcontainer a[title]").tooltip();
       
       
        $jtooltip(document).ready(function() {
        // Tooltip only Text
        $jtooltip('.masterTooltip').hover(function(){
                // Hover over code
                var title = $jtooltip(this).attr('title');
                $jtooltip(this).data('tipText', title).removeAttr('title');
                $jtooltip('<p class="tooltip"></p>')
                .text(title)
                .appendTo('body')
                .fadeIn('slow');
        }, function() {
                // Hover out code
                $jtooltip(this).attr('title', $jtooltip(this).data('tipText'));
                $jtooltip('.tooltip').remove();
        }).mousemove(function(e) {
                var mousex = e.pageX + 20; //Get X coordinates
                var mousey = e.pageY + 10; //Get Y coordinates
                $jtooltip('.tooltip')
                .css({ top: mousey, left: mousex })
        });
});
        </script>


VIPStephan 12-15-2012 07:42 AM

If you post any code please put it in between [CODE][/CODE] tags. It makes scanning your posts much easier. You can do this by clicking the small ‘#’ icon above the reply field.

AndrewGSW 12-15-2012 01:35 PM

Code:

p.className="masterTooltip"

dips255 12-17-2012 11:49 AM

Tried it but no luck

AndrewGSW 12-17-2012 06:04 PM

Quote:

Originally Posted by dips255 (Post 1300499)
Tried it but no luck

Should __SCOLLEVENTTEMP be __SCROLLEVENTTEMP..?

What does your browser's console say?


All times are GMT +1. The time now is 02:27 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.