draggable_DC

Make DC's windows draggable

目前为 2014-06-03 提交的版本。查看 最新版本

// ==UserScript==
// @name		draggable_DC
// @author		Ladoria
// @version		0.11
// @description	Make DC's windows draggable
// @match		http://www.dreadcast.net/Main
// @copyright	2012+, Ladoria
// @namespace GTFO
// ==/UserScript==

// DEBUG Don't touch those damn things!
var global_debug = false;
// /DEBUG

$(document).ready( function() {
	zone_gauche_initiale_offset = $('#zone_gauche').offset();
	zone_droite_initiale_offset = $('#zone_droite').offset();
	
	zone_gauche_initiale_zIndex = $('#zone_gauche').zIndex();
	zone_droite_initiale_zIndex = $('#zone_droite').zIndex();

	$('#zone_gauche').draggable();
	$('#zone_droite').draggable();
	$('#zone_informations_lieu').draggable();
    
    $('#zone_gauche').css('cursor','move');
    $('#zone_droite').css('cursor','move');
    $('#zone_informations_lieu').css('cursor','move');
});

var zIndex = 310000;

$('#zone_gauche').dblclick( function() {
	$('#zone_gauche').offset(zone_gauche_initiale_offset);
	$('#zone_gauche').zIndex(zone_gauche_initiale_zIndex);
});
$('#zone_droite').dblclick( function() {
	$('#zone_droite').offset(zone_droite_initiale_offset);
	$('#zone_droite').zIndex(zone_droite_initiale_zIndex);
});
$('#zone_informations_lieu').dblclick( function() {
	$('#zone_informations_lieu').css('top','auto');
	$('#zone_informations_lieu').css('bottom','10px');
	$('#zone_informations_lieu').css('left','10px');
	$('#zone_centre').zIndex(zone_centre_initiale_zIndex);
});

$('#zone_gauche').mousedown( function() {
	zIndex++;
	$('#zone_gauche').zIndex(zIndex);
});
$('#zone_droite').mousedown( function() {
	zIndex++;
	$('#zone_droite').zIndex(zIndex);
});
$('#zone_centre').mousedown( function() {
	zIndex++;
	$('#zone_centre').zIndex(zIndex);
});

$('#zone_gauche').bind('drag', function(event) {
	$('#zone_gauche').zIndex(zIndex);
});
$('#zone_droite').bind('drag', function(event) {
	$('#zone_droite').zIndex(zIndex);
});
$('#zone_informations_lieu').bind('drag', function(event) {
	$('#zone_informations_lieu').css('position','absolute');
	$('#zone_informations_lieu').css('bottom','auto');
	$('#zone_informations_lieu').zIndex(zIndex);
	
	if(global_debug) console.log($('#zone_informations_lieu').zIndex());
});

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址