Ray's modification before redesign

This commit is contained in:
Christophe Vilayphiou authored and Christophe Vilayphiou committed 2012-01-24 11:57:27 +08:00
1 parent bfd55277d7
commit 5518ae362d
21 files changed
+1000 -578

No files matched your search

+120
View File
@@ -0,0 +1,120 @@
$(document).ready(function(){
dropmenu();
tab();
tooltip();
accordion();
});
function dropmenu(){
if( !$('.rc_dm').length ){
return;
}
$('.rc_dm').each(function(){
$(this)
.find('.dm_ctrl')
.click(function(){
var target = $(this).attr('rel');
var w = $(this).outerWidth();
var h = $(this).outerHeight();
var p = $(this).position();
$('.dm_list').not('#'+target).hide();
$('#'+target)
.css({
width: w,
zIndex: 999,
left: p.left,
top: p.top + h
})
.toggle();
return false;
});
});
$(document).click(function(){
$('.dm_list').hide();
});
}
function tab(){
if( !$('.rc_tab').length ){
return;
}
$('.rc_tab').each(function(){
$(this).find('.tab_ctrl:first').addClass('recent');
$(this).find('.tab_content:not(:first)').hide();
$(this).find('.tab_ctrl').click(function(){
var target = $(this).attr('href');
$(this)
.parents('.rc_tab')
.find('.tab_content').hide()
.end()
.find('.tab_ctrl').removeClass('recent');
$(this).addClass('recent');
$(target).show();
return false;
});
});
}
function tooltip(){
if( !$('.rc_tip').length ){
return;
}
$('.rc_tip').each(function(){
$(this).css({position: 'relative'});
var t = $(this).data('tip');
$(this)
.mouseover(function(){
var th = $(this).find('.td').outerHeight();
var p = $(this).offset();
$(this).append('<span class="td">'+t+'</span>');
$(this).find('.td').show().css('display','inline-block');
$(document).mousemove(function(e){
$(this).find('.td').css({
left: e.pageX - p.left + 16,
top: e.pageY - p.top - th - 20
});
});
})
.mouseout(function(){
$(this).find('.td').hide().detach();
});
});
}
function accordion(){
if( !$('.rc_accor').length ){
return;
}
$('.rc_accor').each(function(){
$(this).find('.ac_ctrl:first').addClass('recent');
$(this).find('.ac_content:not(:first)').hide();
if($(this).hasClass('av')){
$(this).find('.ac_ctrl').click(function(){
var index = $(this).parents('.av').find('.ac_ctrl').index(this);
$(this).siblings('.ac_ctrl').removeClass('recent');
$(this).addClass('recent');
$(this).parents('.rc_accor').find('.ac_content:not(:eq('+index+'))').stop().slideUp();
$(this).parents('.rc_accor').find('.ac_content:eq('+index+')').stop().slideToggle();
return false;
});
} else if($(this).hasClass('ah')){
var w = $(this).find('.ac_content').css('width');
$(this).find('.ac_content:not(:eq(0))').css({width:0});
$(this).find('.ac_ctrl').click(function(){
var index = $(this).parents('.ah').find('.ac_ctrl').index(this);
$(this).siblings('.ac_ctrl').removeClass('recent');
$(this).addClass('recent');
$(this).parents('.rc_accor').find('.ac_content:not(:eq('+index+'))').stop().animate({width:0});
$(this).parents('.rc_accor').find('.ac_content:eq('+index+')').stop().show().animate({width:w});
return false;
});
}
});
}
+4 -4
View File
@@ -393,9 +393,9 @@ modalWindow : function(settings,callbackFn){
}else{tempwidth="auto";}
$rss("body").append('<div class="rgmask" id="rgsheath" style="height:'+rgmaskHeight+'px"></div>');
$rss("#rgsheath").css({background: "#000", width: "100%", position: "fixed", top: 0, left: 0,opacity:0.9,'z-index':199});
$rss("#rgsheath").css({background: "#000", width: "100%", position: "fixed", top: 0, left: 0,opacity:0.5,'z-index':199});
$rss("body").append('<div id="rgWindow"></div>');
$rss("#rgWindow").css({"position": "fixed", "z-index": "999", "background": "#fff", "border": "solid 3px #ccc", "padding": "20px", "overflow": "hidden", "border-radius": "12px", "-webkit-border-radius": "12px", "-moz-border-radius": "12px", "-ms-border-radius": "12px", "box-shadow": "0 0 20px rgba(0,0,0,0.9)","-webkit-box-shadow": "0 0 20px rgba(0,0,0,0.9)","-moz-box-shadow": "0 0 20px rgba(0,0,0,0.9)","-ms-box-shadow": "0 0 20px rgba(0,0,0,0.9)"});
$rss("#rgWindow").css({"position": "fixed", "z-index": "999", "background": "#fff", "border": "solid 1px #ccc", "padding": "10px", "border-radius": "5px", "-webkit-border-radius": "5px", "-moz-border-radius": "5px", "-ms-border-radius": "5px", "box-shadow": "0 0 20px rgba(0,0,0,0.7)","-webkit-box-shadow": "0 0 20px rgba(0,0,0,0.7)","-moz-box-shadow": "0 0 20px rgba(0,0,0,0.7)","-ms-box-shadow": "0 0 20px rgba(0,0,0,0.7)"});
var rgWTop = (rgmaskHeight-20)/2;
var rgWLeft = (rgmaskWidth-20)/2;
$rss("#rgWindow").css({top:rgWTop+"px", left:rgWLeft+"px"});
@@ -433,8 +433,8 @@ modalWindow : function(settings,callbackFn){
$rss("#rgWindow").empty().show();
var closebtn = "";
if(closeBtn)
closebtn='<a href="" style="display:block; width:28px; height:28px; line-height:28px; text-align:center; position:absolute; right:6px; top: 6px; font-family:Tahoma; font-weight:bold; border:solid 1px #ccc; border-radius: 15px;text-shadow:1px 1px 0 #fff; background:#f6f6f6; font-size:14px; text-decoration:none; color:#666" id="close_modal">X</a>';
$rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgWindow").html(closebtn+"<div id='rgContent' style='overflow:auto; overflow-x:none; height:"+tempheight+"px;'>"+dhtml+"</div>");
closebtn='<a href="" style="display:block; width:20px; height:20px; line-height:19px; text-align:center; position:absolute; right:-10px; top: -10px; font-family:Tahoma; font-weight:bold; border:solid 1px #000; border-radius: 10px;text-shadow:0px 1px 0 #DDD; background-color:#CCC; font-size:10px; text-decoration:none; color:#666; padding-left:1px; box-shadow: 0 0 5px #000000;" id="close_modal">X</a>';
$rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgWindow").html(closebtn+"<div id='rgContent' style='padding:5px; overflow:auto; overflow-x:none; height:"+tempheight+"px;'>"+dhtml+"</div>");
$rss("#close_modal").mouseover(function(){$rss(this).css("color","#999");}).mouseout(function(){$rss(this).css("color","#666");})
$rss("#close_modal").click(function(){
$rss("#rgWindow").empty();
+2 -1
View File
@@ -7,4 +7,5 @@
//= require jquery
//= require jquery_ujs
//= require page_edit
//= require side_bar_history
//= require side_bar_history
//= require rc