Jquery hover modal popup

Does anyone know of a jquery modal popup that would work when the cusor hovers over the link and then disappears when the cusor is moved off the modal popup.  If you click on the link it will take the user to a new page, but I want the modal popup to display when hovering over the link that will display a subset of the data that is available when you click on the link and are redirected to the new page.

Here is my a href tag...
<a href="/00U/c?cType=2&md0=2011&md3={!day.dayOfYear}&dtfd={!MONTH(day.date)}/{!DAY(day.date)}/{!YEAR(day.date)}" title="Day View - {!day.date}">{!day.dayofmonth}</a>

Open in new window

-Dman100-Software ConsultantAsked:
Who is Participating?
 
Roman GhermanSenior Software EngineerCommented:
Hi,
This is why I gave you the link to the post: http://extremedev.blogspot.com/2011/02/menu-on-multiple-lines.html

Because it is using the same principle.

Here i have created a sample HTML:
<html>
<head>
  <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
  <script src="http://jquery-ui.googlecode.com/svn/tags/1.8.7/ui/jquery-ui.js"></script>
  <link href="http://jquery-ui.googlecode.com/svn/tags/1.8.7/themes/redmond/jquery-ui.css" type="text/css" rel="stylesheet">

<script>
	var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;

// open hidden layer
function mopen(element, id) {
    // cancel close timer
    mcancelclosetime();

    // close old layer
    mclose();

    // get new layer and show it
    ddmenuitem = document.getElementById(id);
    $("#IE6Fix").height($(ddmenuitem).height());
    $("#IE6Fix").width($(ddmenuitem).width() + 2);

    $("#IE6Fix").show();
    $(ddmenuitem).show();

    $("#IE6Fix").position({
        my: "left top",
        at: "left bottom",
        of: $(element),
        collision: "fit"
    });

    $(ddmenuitem).position({
        my: "left top",
        at: "left bottom",
        of: $(element),
        collision: "fit"
    });
}

// close showed layer
function mclose() {
    if (ddmenuitem) {
        $("#IE6Fix").hide();
        $(ddmenuitem).hide();
    }
}

// go close timer
function mclosetime() {
    closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime() {
    if (closetimer) {
        window.clearTimeout(closetimer);
        closetimer = null;
    }
}

// close layer when click-out
document.onclick = mclose;

</script>  
</head>
<body>
<a href="#" onmouseover="mopen(this, 'testdiv')" onmouseout="mclosetime()">TEST LINK</a>

<div id='testdiv' onmouseover="mcancelclosetime()" onmouseout="mclosetime()" style='width:200px;height:300px;background-color:blue;display:none;'>test</div>

</body>
</html>

Open in new window

0
 
Roman GhermanSenior Software EngineerCommented:
Hi,

You could use jQuery position: http://docs.jquery.com/UI/Position

When hovering set the position, when mouse is out of the popup - hide it.

You can also take a look at this post - it is doing the same thing with the menu:
http://extremedev.blogspot.com/2011/02/menu-on-multiple-lines.html
0
 
-Dman100-Software ConsultantAuthor Commented:
I took a look at the UIPosition, but I was trying the demo and it wasn't working.  Am I missing something?

What should be happening with the UIPosition plugin?  
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Roman GhermanSenior Software EngineerCommented:
the ui position will help you to set the position of your modal popup right where you need near the a href tag.
0
 
-Dman100-Software ConsultantAuthor Commented:
Hi Roma,

My apologies...I probably didn't correctly explain what Iwanted in my post.  The position isn't the issue.  I'm okay if the position is centered or really anywhere on the page.  What I need is a plugin that will display a modal popup when I hover over the link and disappear when I move the cursor off the modal popup dialog.

Does that make any sense?

My apologies for any confusion.

Thanks for your help.  I sincerely appreciate it.
Regards.
0
 
-Dman100-Software ConsultantAuthor Commented:
Hi Roma1123,

Thank you for your help.  It is working now.  I had one additional follow-up question.  When I ran the test page, I got a message "Allow Blocked Content" and when I put the code into our Salesforce environment, I get the message "Do you want to view only the webpage content that was delivered securely"

If I allow the blocked content it works as expected and if I choose "No" for the secure content, it works fine.  

Is there a way to get rid of that message?  Is it because I'm linking to an external site to access the jquery script files?

Do I need to download those files and access them directly instead of over the internet?

Thanks again for your help!
Regards.
0
 
Roman GhermanSenior Software EngineerCommented:
Hi,

The "Allow Blocked Content" will be displayed only when you open the HTML locally.
What about SalesForce - try to copy jquery in the project rather than linking to an external source.

Sorry, but I'm not too common with Salesforce.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.