Changeset 478256
- Timestamp:
- 12/20/2011 10:18:36 PM (14 years ago)
- Location:
- my-record-collection/trunk
- Files:
-
- 2 edited
-
css/mrc_style.css (modified) (2 diffs)
-
js/mrc_scripts.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
my-record-collection/trunk/css/mrc_style.css
r478051 r478256 24 24 /* Jewel Case */ 25 25 ul.music li.jewel img{ width:72px; height:72px; top:3px; left:12px; } 26 ul.music li.jewel a{ background:url(../gfx/jewel.png) 0 0 no-repeat; width:9 0px; height:82px; }26 ul.music li.jewel a{ background:url(../gfx/jewel.png) 0 0 no-repeat; width:96px; height:82px; } 27 27 ul.music li.jewel{ background:url(../gfx/blank_insert.gif) 12px 3px no-repeat; } 28 28 … … 56 56 ul.simple li:nth-child(odd) { background-color: #eee; } 57 57 58 /** MRC_info_tooltip **/ 59 #MRC_info_tooltip { display: none; width: 230px; height: 103px; background: rgba(255,0,0,.5); position: absolute; top: 0px; left: 0px; -webkit-border-radius: 12px; } 60 58 61 59 62 .mrc_d_foot{clear: both; } -
my-record-collection/trunk/js/mrc_scripts.js
r478051 r478256 7 7 8 8 jQuery(document).ready(function($) { 9 10 $('ul.music').MRCinfo(); 9 11 10 12 var music = $('#MyRecordCollection').find('ul.music').children(); … … 62 64 sort = SettingsContainer.find('input[name=sort]:checked').val(), 63 65 way = SettingsContainer.find('input[name=sortway]:checked').val(), 64 num = SettingsContainer.find('#removenum').prop('checked') 66 num = SettingsContainer.find('#removenum').prop('checked'), 65 67 the = SettingsContainer.find('#removethe').prop('checked'); 66 68 if(mode && sort && way){ … … 83 85 music.hover( 84 86 function(){ 85 //console.log('in');87 $('ul.music').MRCinfo('showInfo',$(this)); 86 88 }, 87 89 function(){ 88 //console.log('ut');90 $('ul.music').MRCinfo('hideInfo',$(this)); 89 91 } 90 92 ); … … 92 94 }); 93 95 96 var MRCsettings = { 97 onEachRow: null, 98 tt: $('#MRC_info_tooltip') 99 }; 100 101 (function( $ ){ 102 var methods = { 103 init : function( options ) { 104 105 return this.each(function(){ 106 107 var $this = $(this), 108 data = $this.data('tooltip'); 109 110 MRCsettings.onEachRow = Math.floor($this.parent().width() / 110 ); 111 112 $(document.body).append('<div id="MRC_info_tooltip"></div>'); 113 }); 114 }, 115 leftOrRight : function ( index, width, p ) { 116 var mod = index % MRCsettings.onEachRow, 117 lor = (mod == MRCsettings.onEachRow-1 ? 'left' : 'right'), 118 pos; 119 if(lor == 'right'){ 120 pos = { left : (p.left -10), top: p.top - 12 }; 121 }else{ 122 pos = { right : (p.left + width + 10), top: p.top - 12 }; 123 } 124 return pos; 125 }, 126 getContent : function( elem ) { 127 var artist = elem.find('.mrc_artist').text(), 128 title = elem.find('.mrc_title').text(); 129 return artist+'<br>'+title; 130 }, 131 showInfo : function( elem ) { 132 var lor = methods.leftOrRight(elem.index(),elem.width(),elem.offset()); 133 $('#MRC_info_tooltip').hide().html(methods.getContent(elem)).css(lor).show(); 134 135 }, 136 hideInfo : function( ) { 137 $('#MRC_info_tooltip').hide(); 138 }, 139 update : function( content ) { // ... 140 } 141 }; 142 143 $.fn.MRCinfo = function( method ) { 144 145 if ( methods[method] ) { 146 return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); 147 } else if ( typeof method === 'object' || ! method ) { 148 return methods.init.apply( this, arguments ); 149 } else { 150 $.error( 'Method ' + method + ' does not exist on jQuery.tooltip' ); 151 } 152 153 }; 154 155 })( jQuery ); 94 156 95 157 158
Note: See TracChangeset
for help on using the changeset viewer.