I'm developing web site using MVC3. I created a partial view which contains 4 images placed horizontally. Now i have another view that is detail view and i displayed one text. When user mouse over on that text i want to show my partial view of an image.
How to do this ?
Sorry that i'm including another question in same question because i think it is relevant to above question. So my next issue is -
when that images shown to the user then user select one of image from that list and depending on this i have to perform some operation.
I worked on given answer but i come to know that i can't perform other operation like selection on shown image list.
How to do this too ?
Use jQuery
to get the contents of the partial view and display them on moveover
or a hover
:
For example:
$("#container").mouseover(function() {
$.ajax({
url: "@Url.Action("YourPartialView")",
type: "GET",
success: function(data) {
var htmlx = data; // the View
$("#content").append(htmlx);
$("#content").slideDown('slow');
}
});
});
Where #container
is the area holding your text and #content
is the area that will be displayed when the user hovers over the container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With