ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Codeigniter Rating engine

August 10, 2011 4:19am

Subscribe [3]
  • #1 / Aug 10, 2011 4:19am

    dua0410

    10 posts

    .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;
    }
    <div class=‘rate’> 

    How accurate was the item description?

     
      <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');


    );
    rating_stars= some img of stars
    ratings_over = another img of stars
    ratings_vote = another imf of stars

    Please help me in adding the click functionality to these stars. I am really confused as how to do it. How will I store these values of stars in my database?

  • #2 / Aug 10, 2011 4:27am

    osci

    377 posts

    It’s the lounge here man. Relaxing, shouldn’t it. And if you search for how ajax posts works in forum threads then you’ll get a clue.

  • #3 / Aug 10, 2011 4:42am

    dua0410

    10 posts

    Yea…. i guess is time to relax!!

  • #4 / Aug 10, 2011 11:56pm

    praveens

    73 posts

    dua0410 you posted in wrong place 😉

  • #5 / Aug 11, 2011 9:52am

    Gbecaro

    42 posts

    Perhaps this is not the best place to post, but you cant say it is the “wrong” place… his post seemed quite civil to me…

  • #6 / Aug 11, 2011 9:58am

    praveens

    73 posts

    Mr Gbecaro :cheese:

    The Lounge - CodeIgniter’s social forum where you can discuss anything not related to development.

    Instead off posting here he could have post in Ignited Code 😉

  • #7 / Aug 11, 2011 2:23pm

    Gbecaro

    42 posts

    Can != must
    the only rules i see are “No topics off limits… but be civil.” and on this one is fairly ok… as i said maybe is not in the best one, but isnt wrong… sometimes people get intimidated by the more serious threads and try this one… its ok.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases