Jump to content

Help with a format class


co.ador

Recommended Posts

  Trying to find out why the rating part over here appear in a vertical list and with bullet when in the CSS stylesheet I have it floated to the left and list-style:none;

 

  Price:  $3.50

 

  Raiting:

 

    * 1

    * 2

    * 3

    * 4

    * 5

 

 

 

.rating {

list-style:none;

width:54px;

height:7px;

margin:0 0 3px 0;

padding:0px;

clear:both;

position:relative;

background:url(../images/NYhungry%27s%20grid%20Rating%20system.gif) no-repeat 0 0;

}

 

ul.rating li {

cursor: pointer;

float:left;

text-indent:-900em;

}

 

ul.rating li a {

position:absolute;

left:0;

top:0px;

width:12px;

height:7px;

text-decoration:none;

z-index: 200;

}

 

 

ul.rating li.one a {left:0px}

ul.rating li.two a {left:11px;}

ul.rating li.three a {left:22px;}

ul.rating li.four a {left:33px;}

ul.rating li.five a {left:44px;}

 

ul.rating li a:hover {

z-index:2;

width:54px;

height:7px;

overflow:hidden;

left:0;

background:url(../images/NYhungry%27s%20grid%20Rating%20system.gif) no-repeat 0 0;

list-style:none;

}

ul.rating li.one a:hover {background-position:0 -42px;}

ul.rating li.two a:hover {background-position:0 -49px;}

ul.rating li.three a:hover {background-position:0 -56px;}

ul.rating li.four a:hover {background-position:0 -63px;}

ul.rating li.five a:hover {background-position:0 -70px;}

 

 

HTML code.

if (Rating::CheckRatingsByIp($varItem) == 0)

          {

            $classes      = "rating" . Rating::ShowStars($averageStars);

           

            // Write Output HTML for the Rating Data

            $output  = "\r\n";

            $output .= "<ul class=\"{$classes}\" id=\"{$varItem}\">\r\n";

            $output .= "  <li class=\"one\"><a  href=\"javascript:RateItem('{$varItem}', 1);\" title=\"1 Star\">1</a></li>\r\n";

            $output .= "  <li class=\"two\"><a  href=\"javascript:RateItem('{$varItem}', 2);\" title=\"2 Stars\">2</a></li>\r\n";

            $output .= "  <li class=\"three\"><a href=\"javascript:RateItem('{$varItem}', 3);\" title=\"3 Stars\">3</a></li>\r\n";

            $output .= "  <li class=\"four\"><a  href=\"javascript:RateItem('{$varItem}', 4);\" title=\"4 Stars\">4</a></li>\r\n";

            $output .= "  <li class=\"five\"><a  href=\"javascript:RateItem('{$varItem}', 5);\" title=\"5 Stars\">5</a></li>\r\n";

$output .= "</ul>\r\n";

          }

          else

          {

            $classes      = "rated " . Rating::ShowStars($averageStars);

 

           

            // Write Output HTML for the Rating Data

            $output  = "\r\n";

            $output .= "<ul class=\"{$classes}\" id=\"{$varItem}\">\r\n";

            $output .= "  <li class=\"one\">1</li>\r\n";

            $output .= "  <li class=\"two\">2</li>\r\n";

            $output .= "  <li class=\"three\">3</li>\r\n";

            $output .= "  <li class=\"four\">4</li>\r\n";

            $output .= "  <li class=\"five\">5</li>\r\n";            

            $output .= "</ul>\r\n";

          }

        }

Link to comment
https://forums.phpfreaks.com/topic/166895-help-with-a-format-class/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.