Wijmo ユーザーガイド > ウィジェット > Rating > 操作手順 > カスタムアイコンの使用 |
クイックスタートの例を基に、icons オプションを使用し、css スタイルで画像を指定することで、アイコンに表示される画像を変更できます。
ドロップダウンからスクリプトをコピーして、<head> セクション内に貼り付けます
スクリプト |
コードのコピー |
---|---|
<script id="scriptInit" type="text/javascript"> $(document).ready(function () { $('#ratingDiv').wijrating({ ratingMode: 'single', iconWidth: 150, iconHeight: 150, icons: { iconsClass: ['wijrating-icon-normal-1', 'wijrating-icon-normal-2', 'wijrating-icon-normal-3', 'wijrating-icon-normal-4', 'wijrating-icon-normal-5'], ratedIconsClass: ['wijrating-icon-rated-1', 'wijrating-icon-rated-2', 'wijrating-icon-rated-3', 'wijrating-icon-rated-4', 'wijrating-icon-rated-5'], hoverIconsClass: ['wijmo-wijrating-hover-1', 'wijmo-wijrating-hover-2', 'wijmo-wijrating-hover-3', 'wijmo-wijrating-hover-4', 'wijmo-wijrating-hover-5'] } }); }); </script> |
ドロップダウンからスタイルをコピーして、<head> セクション内に貼り付けます
スクリプト |
コードのコピー |
---|---|
<style type="text/css"> .wijrating-icon-normal-1 { background: transparent url("http://cdn.wijmo.com/images/chrome.png") no-repeat !important; opacity: 0.50; } .wijrating-icon-hover-1{ background: transparent url("http://cdn.wijmo.com/images/chrome.png") no-repeat !important; opacity: 1; } .wijrating-icon-rated-1 { background: transparent url("http://cdn.wijmo.com/images/chrome.png") no-repeat !important; opacity: 1; } .wijrating-icon-normal-2 { background: transparent url("http://cdn.wijmo.com/images/firefox.png") no-repeat !important; opacity: 0.50; } .wijrating-icon-hover-2{ background: transparent url("http://cdn.wijmo.com/images/firefox.png") no-repeat !important; opacity: 1; } .wijrating-icon-rated-2 { background: transparent url("http://cdn.wijmo.com/images/firefox.png") no-repeat !important; opacity: 1; } .wijrating-icon-normal-3 { background: transparent url("http://cdn.wijmo.com/images/ie.png") no-repeat !important; opacity: 0.50; } .wijrating-icon-hover-3{ background: transparent url("http://cdn.wijmo.com/images/ie.png") no-repeat !important; opacity: 1; } .wijrating-icon-rated-3 { background: transparent url("http://cdn.wijmo.com/images/ie.png") no-repeat !important; opacity: 1; } .wijrating-icon-normal-4 { background: transparent url("http://cdn.wijmo.com/images/opera.png") no-repeat !important; opacity: 0.50; } .wijrating-icon-hover-4{ background: transparent url("http://cdn.wijmo.com/images/opera.png") no-repeat !important; opacity: 1; } .wijrating-icon-rated-4 { background: transparent url("http://cdn.wijmo.com/images/opera.png") no-repeat !important; opacity: 1; } .wijrating-icon-normal-5 { background: transparent url("http://cdn.wijmo.com/images/safari.png") no-repeat !important; opacity: 0.50; } .wijrating-icon-hover-5{ background: transparent url("http://cdn.wijmo.com/images/safari.png") no-repeat !important; opacity: 1; } .wijrating-icon-rated-5 { background: transparent url("http://cdn.wijmo.com/images/safari.png") no-repeat !important; opacity: 1; } </style> |
ドロップダウンからスクリプトをコピーして、<head> セクション内に貼り付けます
スクリプト |
コードのコピー |
---|---|
<div id="ratingDiv"></div> |