Reputation: 20946
Im looing for a way to have a simple "on mouse over"-effect. (I want the page to show a dialogbox)
Upvotes: -1
Views: 921
Reputation: 1221
Use some Javascript.
Jquery makes thoose things quite easy. Do you already have the information or is it something you want to pull from the server when the mouse is hovering?
With Jquery you could do something like this
<script type="javascript">
$(document).ready(
function(){
$("divToShow").hide();
$('#objectWithMouseOver').mouseover(onMouseOver());
});
function onMouseOver()
{
$('#divToShow').show();
}
</script>
<body>
<div id="divToShow">
whatever info you want to show....
</div>
<div id="objectWithMouseOver">
when you drag mouse over here the other will show
</div>
I would use addclass removeclass instead of show/hide to get better control. Its not hard to extend it to call mvc controls and populate data using ajax. Add some parameters to the function and the use jquery.ajax functions.
Upvotes: 3
Reputation: 1165
use css
Have a hidden div and a :hover on the word you wish to attach the popup to
You will need to have a helper JS script to load this in IE6
<span class="WordHighlight">word
<div class="hiddenPopup">some words about the word</div></span>
CSS
.WordHighlight{text-decoration:dotted}
.WordHighlight .hiddenPopup{display:none;/* add popup style */}
.WordHighlight:hover .hiddenPopup{display:inline;}
.WordHighlightHover .hiddenPopup{display:inline;}
add the script in a
I will try to get back to finish this later
Upvotes: 1
Reputation: 18230
Adding to that jQuery is now being supported in intellisense by Microsoft so it's worth using with ASP.NET MVC Framework.
Upvotes: 1