Codeigniter Rating engine |
[eluser]dua0410[/eluser]
.rate_widget { border: 1px solid #CCC; overflow: visible; padding: 10px; position: relative; width: 180px; height: 32px; } .ratings_stars { background: url('http://i52.tinypic.com/242a0qq.png') no-repeat; float: left; height: 28px; padding: 2px; width: 32px; } .ratings_vote { background: url('http://i51.tinypic.com/23uu3o1.png') no-repeat; } .ratings_over { background: url('http://i52.tinypic.com/2qvfg5h.png') no-repeat; } <h4> Rate details about the advertisment</h4> <div class='rate'> <h5> How accurate was the item description?</h5> <div id="q1" class="rate_widget"> <div class="star_1 ratings_stars" id="1"></div> <div class="star_2 ratings_stars" id="2"></div> <div class="star_3 ratings_stars" id="3"></div> <div class="star_4 ratings_stars" id="4"></div> <div class="star_5 ratings_stars" id="5"></div> </div> </div> [removed] $('.ratings_stars').hover( // Handles the mouseover function() { $(this).prevAll().andSelf().addClass('ratings_over'); $(this).nextAll().removeClass('ratings_vote'); }, // Handles the mouseout function() { $(this).prevAll().andSelf().removeClass('ratings_over'); } ); //Hey I am developing a rating engine... I have kind of devloped the stars part. But i am not able to understand as how to give the click functionality to my stars and how will the value of stars be stored in my database. Can you please help me? I am new to codeigniter.
[eluser]Wondering Coder[/eluser]
why don't you try using star-rating in jquery. Actually I've just used this plugin last 3days.
[eluser]Wondering Coder[/eluser]
it's in my laptop. sorry, I'm actually using my desktop right now. But it's very easy to implement. Just search the plugin in jQuery star-rating v.3. it's something like this: <input type='radio' name='radio1' class='star' value='1' title='Poor'> <input type='radio' name='radio1' class='star' value='2' title='Fair'> <input type='radio' name='radio1' class='star' value='3' title='Outstanding'> etc..
[eluser]dua0410[/eluser]
Ok I will try this. But I request you to please post the complete code here whenever you use your laptop. And I have a doubt will the code you have just posted form star like shapes??
[eluser]Mirge[/eluser]
[quote author="dua0410" date="1313049932"]Ok I will try this. But I request you to please post the complete code here whenever you use your laptop. And I have a doubt will the code you have just posted form star like shapes??[/quote] jQuery Star Rating Plugin: http://tinyurl.com/43alk4f
[eluser]dua0410[/eluser]
It creates a set of radio buttons... I want it proper stars!!
[eluser]Mirge[/eluser]
[quote author="dua0410" date="1313065549"]It creates a set of radio buttons... I want it proper stars!![/quote] See screenshot: http://screencast.com/t/Uc5d3b2Mxk And URL to the exact plugin (that was the first search result): http://www.fyneworks.com/jquery/star-rating/ |
Welcome Guest, Not a member yet? Register Sign In |