Create a 5 star-rating control with hover images without JavaScript - c#

Is there a way to implement a 5-star rating control, that supports changing the images of the 5 stars upon hover, without the use of Javascript? A click would need to perform a HTTP POST
To get a better understanding I searched for a sample and found http://orkans-tmp.22web.net/star_rating/ (Scroll to "Quick example with SELECT options")
As far as my knowledge of HTML goes, it is not possible to have multiple images / buttons that perform a Post (to know which rating was given by the user), and simultaneously change multiple background images.

Here is an example from CSS3 Secrets
jsfiddle
You can use css selectors to get what you want done without javascript.

You can change the image using CSS. Just apply a class and give it the :hover option.
i.e.
.star:hover
{
color:blue;
}
I assume that you would want all previous stars to change color as well on hover, this would be possible, but quite difficult. We'll start with an image of 5 starts (all highlighted) and an image of a single unhighlighted start. Place five of the unhighlighted starts right on top of each other (set the absolute postion). Adjust the intend of the stars so that each is indented more than the last and they are laid out properly (without actually overlapping each other). Add a CSS on hover that's different for each one. It will need to replace the image with the 5 stared highlighted image. The width will need to be set so that only the appropriate number of stars is shown. The z-index will need to be set so that it is on top of the unhighlighted images of all previous stars.

Is it possible 2 use the OnMouseOver and OnMouseOut option to create the same effect of a hover?

Related

How to setup a shopping based UI for different screen sizes in unity?

I am trying to set up a shopping based UI for different screen sizes.In the canvas settings inside the Inspector I have given a reference resolution of 750 x 1334(Iphone 6)
UI scale mode - Scale with screen size
Match(Width-Height) - 0.5 (Which I change to one can see them in the images)
Somehow I placed the Images and text according to given design.It looks ok in the Iphone resolution.But in Ipad the buttons and text gets mixed up.
Now I change the Match(Width-Height) - 1 .The result is it looks okay but in the ipad view it looks small and there is plenty of space along the two sides.
How to get a matching view/look for all the different screen sizes.
Images are given below
Actually, u don't need to change the match size.
what u actually have to use are anchors. If u use anchors no matter how the size of the screen changes the UI element will resize with it.
see this video from unity officials. It will definitely solve ur issue.
https://www.youtube.com/watch?v=FeheZqu85WI&list=PLX2vGYjWbI0Qp0sD8_RKgbWul7z_eyNAv&index=2
thank you.
U can accept this answer if this solves ur issue.

C# WPF Image + 2 Texts in a list

I want to create a WPF a similar to the one in the image so that i can Bind the Image Source, The Movie Name & The Category (Ignore the left side)
Is this a ListView ? I tried many different combos but i couldn't make it as the one above.
Also, since it is related to that question, how i can have dynamically column number based on the Window size? For example in the image above the columns are 5, but i want it to be dynamically based on the Window Pixel/Size. Is this possible?
A lot of work to learn how to do it in a ListView. I'm not sure if the widths can be dynamic (based on each image width) but I've done it similarly to how Windows Explorer Icons views does it. So extra large, large, etc.
A good starting point for this is at https://msdn.microsoft.com/en-us/library/ms748859
But it's a tonne of work. Probably 2 or 3 months. They only give you bits and pieces and it's a variety of C# and VB.
You might want a more low-level ItemsControl.
Try the example from here: http://www.wpf-tutorial.com/list-controls/itemscontrol/
The one that might work for you is the WrapPanel as it will change the wrapping / layout based on the available container size and the item size.
Your Image and Text controls with bindings would go in the DataTemplate.

Color the background of a piece of text in a PDF document using iTextSharp

How do I set the background color of a piece of text in a PDF document using iTextSharp without taking a form field?
The answer in this post uses a FormField, which according to me is an overkill and too long-winded a way to do something really simple.
Is there a simple way of coloring the background of a piece of text?
You can use the method SetBackground that is available in the Chunk class. There are two variations of this method: one that takes default padding and one that allows you to change the padding.
If you use the onGenericTag() method on a Chunk, you can draw a custom background (and do much more). For instance: you'd use onGenericTag() if you want to draw a rectangle with rounded corners. See my answer to your duplicate question Draw a rectangle at the *current position* and then get its position coordinates
After some trying, I have come to the conclusion that there are 3 ways to do this other than using the FormField (which is the fourth way and how to do that is already linked in the question):
1) Judging from this answer to another similar question, it appears as though there is no concept of a background color for text in the PDF specification. Therefore, one has to draw a rectangle at an absolute position before drawing the text (at that position).
This is like drawing on a Win32 DeviceContext.
2) You can draw a table and set the background color of the cell in which you want a background color.
3) You can write a chunk. The Chunk class has a method named SetBackground(). This doesn't look very nice because it doesn't let you control the padding around the text and between the borders of the box. You can control how far above the baseline the bottom of the text will appear by calling the chunk.SetTextRise(float f) method but that's about it. Still, it's a fast and easy way to get things done if you don't want too much beautification.

Path Intersection Removing excess path

Hej
Lets say I have a cirkel as my usercontrol in a Windows Phone 8 application, And I add elements inside a Geometry group, with a rectangel and a line. I would get the following:
(source: c-sharpcorner.com)
I am interested in having my cirkel as the main element. To specify I want the everything else to only be displayed in the region of the cirkel.
So if the rectangle was red I would only get the red corner displayed.
I have code that can manage inserting and moving objects. But I do not know how to make the intersect work opporsit of the picture.
I have tried a bit of the same in a small sample as is done in this link:
the link is http://www.c-sharpcorner.com/uploadfile/mahesh/path-in-wpf/
Anybody has an idea for this?
Best
So the Best solution I found is to convert your element to WriteableBitmap, and then setting this as the background of your wished shape.
So to acheive the above if you have the elements as geometric shapes you can use this link to get the path of the object.
http://www.c-sharpcorner.com/uploadfile/mahesh/path-in-wpf/

how can I enlarge the boundaries of an html table

There are many tables nested inside as it showd in the following three images.
Please give an idea so that I can see the circled images fully in the third image..
ps: if you want any html code of o a part, I can share it here on request..
Now
1
alt text http://img148.imageshack.us/img148/5750/21619773.jpg
2
alt text http://img408.imageshack.us/img408/2884/30078896.jpg
The Desired Html Page:
The Final Scene:
Having trouble understanding your question... if you're looking to enlarge a table, it might be as simple as setting the width. However, you'll get more of what I think you're looking for if you're usings divs and/or floats instead of tables... tables tend to make your layout very rigid and un-fluid.
If you're looking to move content to different areas on the page after the expand, this can be done in javascript by manipulating the DOM... I can't be more specific without understanding what you're trying to do.
Can you post a picture of what you want it to look like afterwards? The circles and arrows aren't giving me a clear understanding.

Categories

Resources